Who is using GraphQL?
GraphQL History
Core Concepts
Schema Definition
REST vs GraphQL
GraphQL is a PATTERN not a technology
Client queries are shaped just like the data it returns
Language agnostic
GraphQL has a formal specification
An alternative to SQL
Facebook Graph AP
Limited to specific database(s)
Limited to HTTP
Limited to JavaScript/NodeJS on the backend
A REST replacement
Schema: defines the API structure itself-Core concept
Type: definition of a model(Person, Order, Product.)
Scalar Type: Int, Float, Boolean, String, ID and custom scalar type(e.g. Date)
Object Type: An object type contains a collection of fields, each of which has its own type.
Query: Definitions to query data(fetch)
Mutation: Definition to mutate data
Subscription: Allows a server to send data to its clients when a specific event happens
USE CASE:
REST way:
GraphQL way:
BUT:
dyncan.com / GitHub / LinkedIn / Twitter