Skip to content

Instantly share code, notes, and snippets.

@peterpme
Last active March 1, 2018 05:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterpme/ce289134a78cb7232e0091c0e3949338 to your computer and use it in GitHub Desktop.
Save peterpme/ce289134a78cb7232e0091c0e3949338 to your computer and use it in GitHub Desktop.
User Mutation Clarification - imagine User having 20 keys, 5 of which are non-nullable (email_verified: Boolean!)
type User = {
id: ID!
first_name: String
last_name: String
email_verified: Boolean!
}
input UpdateUserInput {
first_name: String
last_name: String
}
type UpdateUserPayload {
first_name: String
last_name: String
}
type Mutation {
// I wish I could do this (despite email_verified)
updateUser(input: UpdateUserInput!): User
// but I have to do this:
updateUser(input: UpdateUserInput!): UpdateUserPayload
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment