Last active
May 29, 2020 04:38
-
-
Save Wonder2210/76200ff85da74ff0ba1ea574dce3c248 to your computer and use it in GitHub Desktop.
Basic Graphql schema
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
enum Species{ | |
BIRDS, | |
FISH, | |
MAMMALS, | |
REPTILES | |
} | |
type User { | |
id: Int! | |
full_name: String | |
country_code: String | |
created_at:String | |
pets:[Pet] | |
} | |
type Pet { | |
id: Int! | |
name: String | |
owner_id: Int! | |
specie: Species | |
created_at:String | |
owner:User | |
} | |
input createUserInput{ | |
full_name: String! | |
country_code: String! | |
} | |
input createPetInput{ | |
name: String! | |
owner_id: Int! | |
specie: Species! | |
} | |
input updateUserInput{ | |
id:Int! | |
full_name: String | |
country_code: String | |
} | |
input updatePetInput{ | |
id:Int! | |
name: String! | |
} | |
type Query{ | |
pets:[Pet] | |
users:[User] | |
user(id:Int!):User | |
pet(id:Int!):Pet | |
} | |
type Mutation{ | |
createPet(pet:createPetInput!):Pet | |
createUser(user:createUserInput!):User | |
deletePet(id:Int!):String | |
deleteUser(id:Int!):String | |
updatePet(pet:updatePetInput!):Pet | |
updateUser(user:updateUserInput!):User | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment