Skip to content

Instantly share code, notes, and snippets.

@ThisIsMissEm
Created October 2, 2019 05:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ThisIsMissEm/09ece11f1bc77318c845ae8fdbf1147f to your computer and use it in GitHub Desktop.
Save ThisIsMissEm/09ece11f1bc77318c845ae8fdbf1147f 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