Last active
June 5, 2018 20:48
-
-
Save clarencenpy/27c3c3ad0e735d3b4c033d58ae0c869b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const typeDefs = gql` | |
# define wrapper result type that could return either | |
# the added Event on success, or an array of Errors | |
# on error. Notice both fields are nullable. | |
type AddEventResult { | |
event: Event | |
validationErrors: [FieldValidationError!] | |
} | |
# define how you want errors to be represented. This | |
# can be as complex as your app requires | |
type FieldValidationError { | |
field: String! | |
message: String! | |
(... any other fields you need) | |
} | |
input EventInput { | |
name: String! | |
date: Date! | |
capacity: Int! | |
photoUrl: String! | |
} | |
type Mutation { | |
addEvent(event: EventInput!): AddEventResult! | |
} | |
`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment