Skip to content

Instantly share code, notes, and snippets.

@ianrodrigues
Forked from ThisIsMissEm/Schema.graphql
Created April 24, 2020 19:30
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 ianrodrigues/1010f075ddb911053fb3063e426f69e1 to your computer and use it in GitHub Desktop.
Save ianrodrigues/1010f075ddb911053fb3063e426f69e1 to your computer and use it in GitHub Desktop.
Form Validation as a Result Union
mutation updateUser(
details: UpdateUserInput!
): UpdateUserResult
union UpdateUserResult =
UpdateUserSuccess |
FormValidationError
type UpdateUserSuccess {}
type FormValidationError {
errors: [FieldValidationError!]!
}
type FieldValidationError {
field: String!
code: String!
message: String!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment