Last active
December 3, 2018 03:19
-
-
Save meshboy/56366c24d8b293fe996b49dea216b3de to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| type Recipe { | |
| id: ID! | |
| name: String! | |
| description: String! | |
| difficultyLevel: Int! | |
| image: String | |
| steps: [String]! | |
| averageTimeForCompletion: Int! | |
| user: User! | |
| } | |
| input NewRecipe { | |
| name: String! | |
| description: String! | |
| difficultyLevel: Int! | |
| image: Upload | |
| steps: [String]! | |
| averageTimeForCompletion: Int! | |
| } | |
| input UpdateRecipe { | |
| id: ID! | |
| name: String | |
| description: String | |
| difficultyLevel: Int! | |
| image: String | |
| steps: [String] | |
| averageTimeForCompletion: Int! | |
| } | |
| input DeleteRecipe { | |
| id: ID! | |
| } | |
| # query is use when you want to get anything from | |
| #the server just like (GET) using REST | |
| extend type Query { | |
| Recipe(id: ID!): Recipe! | |
| Recipes: [Recipe]! | |
| } | |
| # performing actions (that requires DELETE, PUT, POST) | |
| #just as in REST requires a mutation | |
| extend type Mutation { | |
| deleteRecipe(input: DeleteRecipe!): Recipe! | |
| updateRecipe(input: UpdateRecipe!): Recipe! | |
| newRecipe(input: NewRecipe!): Recipe! | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment