Bartlomiej Skwira
August 2017, source: https://jaxenter.com/state-of-api-integration-report-136342.html
*hosted by the non-profit Linux Foundation
GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. *
*official definition from https://graphql.org
1. Define types and fields:
2. Provide function for each field on each type
3. Run a graph service:
4. Run a query:
The server:
4. Run a query:
{ me { name } }
{ "me": { "name": "Luke Skywalker" } }
JSON result
Example query
Ask for a specific field -> get the same shape as result
Query objects
Arguments
Aliases to rename the result
1. Ask for a specific field -> get the same shape as result
Fragments - reusable sets of query fields
Explicit operation name
Operation == query or mutation or subscription
Variables for dynamic queries
Directives
Mutations
Object types
type Starship {
id: ID!
name: String!
length(unit: LengthUnit = METER): Float
appearsIn: [Episode!]! }
Scalar types:
Enum Types:
Interfaces
Union
Authorization -> business logic layer
Who is using GraphQL?
and more https://graphql.org/users/