Introduction to
GraphQL
> REST & GraphQL
> GraphQL Jargons
> Demo with GitHub APIs
> Tool Chains
> Workshop - Exploring the world of Pokemons with GraphQL
Agenda
Sakthivel Viswanathan
Senior Consultant, ThoughtWorks
Speakers Introduction
Muhil Varnan V
Consultant, ThoughtWorks
REST
Challenges faced when
working with REST?
Over-fetching & Under-fetching
> Rapid UI changes, when we scale and iterate our product
> No documentation, API explorability and schema
> No enforcement of specification
> New endpoints for new features
Other limitations?
What is GraphQL?
> Query language for the API
> Server runtime
> Specification
> Declarative data fetching
GraphQL History
2018
GraphQL Foundation,
Hosted by Linux Foundation
2012
Internally used by
facebook
2015
Publicly released
Schema
Scalar Types
Int Integer
Float Float
String String
Boolean Boolean
ID ID
Type Modifiers
String Nullable string
String! Required string
[String] List of strings
[String]! Required list of strings
[String!]! Required list of required strings
> Design or blueprint for our data.
> Schema has the type information, queries, mutations etc..
devhints.io/graphql
Schema
Express the data you have in the form of Schema
Query
Denote the data you require
> Request what we need
> Response will match what we
requested
> No Over-fetch and No Under-
fetch
Root Types
> A function implementing a GraphQL field
> Flexible - Query API, Query Database or any
other sources
Resolvers
REST GRAPHQL
http http/websocket/TCP
GET
POST
PUT
PATCH
DELETE
Methods
POST
Methods
Query
Mutation
Subscription
Action Types
GET
Checkpoint
> Limitations with REST
> What is GraphQL?
> Schema, Root Types, Resolvers
Demo
Github
Thinking in Graphs
What GraphQL is not?
> Specific to React
> Database technology
> Supports only Javascript
Caveats
> Caching
> Exposed to arbitrary requests
> Monitoring
Takeaways
> Schema, Root Types, Resolver
> Not a database technology
Pokemons
Exploring world of
With GraphQL
Don’t know what is pokemon?
Pokemon Types
Grass
Electric
Fire
water
Pokemon World
Capturing a pokemon
Apollo
https://graphql.org/code/
GraphQL Implementations

Introduction to graphQL