Last active
May 25, 2018 13:07
-
-
Save Wizyma/a4f5fa5ab82e8936e483233452f8984f to your computer and use it in GitHub Desktop.
GraphQL medium
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
// Schema definition | |
type Query { | |
user(username: String!): User! | |
} | |
type User { | |
username: String! | |
firstname: String! | |
lastname: String! | |
age: Int! | |
country: String | |
} | |
// Client query | |
{ | |
user(username: "paco"){ | |
firstname | |
age | |
} | |
} | |
// Server Response | |
{ | |
"user": { | |
"firstname": "Gintama", | |
"age": 26 | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment