by Gian Marco Toso - @gianmarcotoso
APIConf 2018
starting at 11:30
/* Define the schema */
type Product {
id: ID!
name: String!
price: Float!
}
type Customer {
id: ID!
email: String!
}
type Order {
products: [Product]!
customer: Customer!
comment: String
}
/* Call the /graphql endpoint */
{
orders(email: 'frank@example.com') {
products {
name
}
}
}
/* Get a JSON response! */
{
orders: [
{ products: ['PS4', 'A Game'] },
{ products: ['Washing Machine'] },
{ products: ['Dishwasher'] }
]
}