ZhuangER
9/9/2018 - 3:46 AM

item.gql

import userSchema from './user.gql';

function create() {
  return apolloClient.mutate({
    mutation: userSchema.create,
    variables: {
      ....
    },
  });
}
mutation create(...) {
  userMutation {
    create(...) {
      ...
    }
  }
}

mutation update(...) {
  userMutation {
    update(...) {
      ...
    }
  }
}

mutation delete(...) {
  userMutation {
    update(...) {
      ...
    }
  }
}
mutation create(...) {
  itemMutation {
    create(...) {
      ...
    }
  }
}

mutation update(...) {
  itemMutation {
    update(...) {
      ...
    }
  }
}

mutation delete(...) {
  itemMutation {
    update(...) {
      ...
    }
  }
}