Web
GraphQL
Queries, mutations, schema types, and HTTP transport.
Queries
# Basic field
{ status }
# Nested
{ hero { name height } }
# With argument
{ hero(id: "1000") { id name } }
# Aliases
{ luke: hero(id: "1000") { name }
han: hero(id: "1001") { name } }Named query & variables
query FindHero($id: String!) {
hero(id: $id) {
name
friends { name }
}
}Mutations
mutation CreateReview($review: ReviewInput!) {
createReview(review: $review) {
id
stars
commentary
}
}Fragments & unions
{ search(q: "ada") {
id
... on User { name }
... on Comment { body author { name } }
}
}Schema types
type Query { me: User }Root query typetype User { id: ID! name: String }Object typeInt, Float, String, Boolean, IDScalar typesString!Non-null field[String!]!Non-null list of non-null stringsinterface Entity { id: ID! }Interfaceenum STATUS { ACTIVE INACTIVE }Enum typeunion Result = User | PostUnion typeHTTP transport
GET ?query={ me { name } }GET with query paramPOST body: { query, variables }POST with variables