SlideShare a Scribd company logo
1 of 34
Download to read offline
Graph QL
By - Deepak Shevani
Hello !!
I am Deepak Shevani
- Work at Microsoft for Azure group
- Recently got interested in GraphQL
- Contact : shevanideepak@gmail.com
Recognize this ?
3
History of Web Services
4
1960 1990 2000 2018
RPC SOAP REST GRAPHQL
REST Drawbacks
▧ Client Options : Http Verbs (GET, PUT, POST)
▧ Resources : /users /users/1 /users/1/posts
▧ No control over which fields to select
▧ Versioning of APIs is painful
▧ Overfetching / Underfetching
▧ Managing multiple endpoints is headache
▧ Change Process hindering agility
5
GraphQL origins ?
▧ In 2012, FB decided to rebuild native apps
▧ FB then used RESTful services & FQL
▧ Idea : Improving client server communication
▧ Result : In 2015, open sourced GraphQL
▧ Also provided reference implementation (js)
6
1.
What is GraphQL ?
Will it kill REST ?
7
1000 foot view
8
Query Data
Communication Medium
1000 foot view
9
Query Data
10
graphql.org
Meet GraphQL
QUERY LANGUAGE
GraphQL defines query language and
query is validated against type system
which is blueprint for API Data
SERVER SIDE RUNTIME
GraphQL provides server side runtime to
parse and route queries to fetch desired
data for the caller
More info about GraphQL can be found at
http://graphql.org/learn
11
STRONGLY TYPED
GraphQL allows you to do domain first
design that generates types and schema
CLIENT CENTRIC
GraphQL has developer centric view biased
towards clients
Meet GraphQL
QUERY LANGUAGE
GraphQL defines query language and
query is validated against type system
which is blueprint for API Data
SERVER SIDE RUNTIME
GraphQL provides server side runtime to
parse and route queries to fetch desired
data for the caller
More info about GraphQL can be found at
http://graphql.org/learn
12
STRONGLY TYPED
GraphQL allows you to do domain first
design that generates types and schema
CLIENT CENTRIC
GraphQL has developer centric view biased
towards clients
What is GraphQL
QUERY LANGUAGE
GraphQL defines query language and
query is validated against type system
which is blueprint for API Data
SERVER SIDE RUNTIME
GraphQL provides server side runtime to
parse and route queries to fetch desired
data for the caller
More info about GraphQL can be found at
http://graphql.org/learn
13
STRONGLY TYPED
GraphQL allows you to do domain first
design that generates types and schema
CLIENT CENTRIC
GraphQL has developer centric view biased
towards clients
Transport Agnostic
14
Example GraphQL Query
15
{
employee (id: 35) {
firstName
lastName
email
}
Resource Identifier
Required Fields
Example GraphQL Query
16
{
employee (id: 35) {
firstName
lastName
email
}
Resource Identifier
Required Fields
Id FirstName LastName Email DOB Salary Manager YOE
35 Deepak Shevani --- --- --- --- ---
36 Amit Sharma --- --- --- --- ---
Example GraphQL Query
17
{
employee (id: 35) {
firstName
lastName
email
}
Resource Identifier
Required Fields
Id FirstName LastName Email DOB Salary Manager YOE
35 Deepak Shevani --- --- --- --- ---
36 Amit Sharma --- --- --- --- ---
GET /api/employees/35
Example GraphQL Query
18
{
employee (id: 35) {
firstName
lastName
email
}
{
"employee" : {
"firstName" : "Deepak",
"lastName" : "Shevani",
"email" : "abc@y.com"
}
Example GraphQL Query
19
{
employee (id: 35) {
firstName
lastName
email
}
Nothing more, nothing less !!
Resolvers tells query where to go
“
20
REST GraphQLvs
What is GraphQL
QUERY LANGUAGE
GraphQL defines query language and
query is validated against type system
which is blueprint for API Data
SERVER SIDE RUNTIME
GraphQL provides server side runtime to
parse and route queries to fetch desired
data for the caller
More info about GraphQL can be found at
http://graphql.org/learn
21
Queries
Mutations
Subscriptions Fragments
Type System
Validation
Execution
GraphQL
Queries
22
Queries
Fetch data
Describes what data you want to fetch
from server. Response from server reflects
what you ask in query (selection sets). We
can create fragments to create reusable
selection sets
Query is GraphQL root type, as it maps to
an operation
Each field in selection set can have scalar
or object type.
Example
fragment basicInfo on Employee {
name
email
}
query {
employee (id : 35) {
... basicInfo
}
}
More info about GraphQL can be found at
http://graphql.org/learn
23
GraphQL
Mutations
24
GraphQL Operations
25
query GetTweets {
allTweets {
text
user
}
}
mutation Post ($body : String!) {
addTweet (body : $body) {
id
}
}
Query Operation
Mutation Operation
variables : { body : "LSPE 15th" }
variables : { body : "Loving it" }
Mutations
Update or Delete data
Like queries, we could name them. We
could also include selection sets to define
return types
Mutations are also root types, and they
usually include variables
Example
mutation createSong($title:String! $one:Int) {
addSong(title:$title, numberOne:$one) {
id
title
numberOne
}
}
More info about GraphQL can be found at
http://graphql.org/learn
26
GraphQL
Subscriptions
27
Subscriptions
Real time updates
Using web sockets, you could listen to real
time updates from the server
At Facebook, the use case was to fetch real
time likes on a page without getting
refreshed
Subscriptions are also root types
Example
subscription {
liftStatusChange {
name
capacity
status
}
}
More info about GraphQL can be found at
http://graphql.org/learn
28
Query Language
QUERY
query {
programs {
name
status
}
}
FRAGMENTS
fragment liftInfo on Lift {
name
status
capacity
night
elevationGain
}
29
MUTATIONS
mutation {
create(id: "program" status: OPEN) {
name
status
}
}
SUBSCRIPTIONS
subscription {
liftStatusChange {
name
capacity
status
}
}
Pros ?
30
Benefits
No Overfetching
.
No Underfetching Use queries
.
Easy deprecation Single Endpoint No custom endpoints
Cons
32
Cons
Learning Curve
.
Setup Required No Http Caching
.
Thanks!
Any questions?
You can find me at:
@deepak_shevani
shevanideepak@gmail.com
34

More Related Content

What's hot

Build GraphQL APIs with Graphene (Big Mountain Data & Dev 2019)
Build GraphQL APIs with Graphene (Big Mountain Data & Dev 2019)Build GraphQL APIs with Graphene (Big Mountain Data & Dev 2019)
Build GraphQL APIs with Graphene (Big Mountain Data & Dev 2019)Ayla Khan
 
GraphQL London January 2018: Graphql tooling
GraphQL London January 2018: Graphql toolingGraphQL London January 2018: Graphql tooling
GraphQL London January 2018: Graphql toolingSøren Bramer Schmidt
 
GraphQL Advanced
GraphQL AdvancedGraphQL Advanced
GraphQL AdvancedLeanIX GmbH
 
GraphQL: Enabling a new generation of API developer tools
GraphQL: Enabling a new generation of API developer toolsGraphQL: Enabling a new generation of API developer tools
GraphQL: Enabling a new generation of API developer toolsSashko Stubailo
 
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...luisw19
 
GraphQL in an Age of REST
GraphQL in an Age of RESTGraphQL in an Age of REST
GraphQL in an Age of RESTYos Riady
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQLBrainhub
 
How web works and browser works ? (behind the scenes)
How web works and browser works ? (behind the scenes)How web works and browser works ? (behind the scenes)
How web works and browser works ? (behind the scenes)Vibhor Grover
 
Better APIs with GraphQL
Better APIs with GraphQL Better APIs with GraphQL
Better APIs with GraphQL Josh Price
 
GraphQL Introduction
GraphQL IntroductionGraphQL Introduction
GraphQL Introductionbobo52310
 
Modern APIs with GraphQL
Modern APIs with GraphQLModern APIs with GraphQL
Modern APIs with GraphQLTaikai
 
Getting started with GraphQL
Getting started with GraphQLGetting started with GraphQL
Getting started with GraphQLThiago Colares
 
Tutorial: Building a GraphQL API in PHP
Tutorial: Building a GraphQL API in PHPTutorial: Building a GraphQL API in PHP
Tutorial: Building a GraphQL API in PHPAndrew Rota
 
Building a GraphQL API in PHP
Building a GraphQL API in PHPBuilding a GraphQL API in PHP
Building a GraphQL API in PHPAndrew Rota
 
The Apollo and GraphQL Stack
The Apollo and GraphQL StackThe Apollo and GraphQL Stack
The Apollo and GraphQL StackSashko Stubailo
 
GraphQL across the stack: How everything fits together
GraphQL across the stack: How everything fits togetherGraphQL across the stack: How everything fits together
GraphQL across the stack: How everything fits togetherSashko Stubailo
 

What's hot (20)

Build GraphQL APIs with Graphene (Big Mountain Data & Dev 2019)
Build GraphQL APIs with Graphene (Big Mountain Data & Dev 2019)Build GraphQL APIs with Graphene (Big Mountain Data & Dev 2019)
Build GraphQL APIs with Graphene (Big Mountain Data & Dev 2019)
 
Graphql
GraphqlGraphql
Graphql
 
GraphQL London January 2018: Graphql tooling
GraphQL London January 2018: Graphql toolingGraphQL London January 2018: Graphql tooling
GraphQL London January 2018: Graphql tooling
 
GraphQL
GraphQLGraphQL
GraphQL
 
GraphQL Advanced
GraphQL AdvancedGraphQL Advanced
GraphQL Advanced
 
GraphQL: Enabling a new generation of API developer tools
GraphQL: Enabling a new generation of API developer toolsGraphQL: Enabling a new generation of API developer tools
GraphQL: Enabling a new generation of API developer tools
 
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
 
GraphQL in an Age of REST
GraphQL in an Age of RESTGraphQL in an Age of REST
GraphQL in an Age of REST
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQL
 
How web works and browser works ? (behind the scenes)
How web works and browser works ? (behind the scenes)How web works and browser works ? (behind the scenes)
How web works and browser works ? (behind the scenes)
 
GraphQL + relay
GraphQL + relayGraphQL + relay
GraphQL + relay
 
Better APIs with GraphQL
Better APIs with GraphQL Better APIs with GraphQL
Better APIs with GraphQL
 
GraphQL & Relay
GraphQL & RelayGraphQL & Relay
GraphQL & Relay
 
GraphQL Introduction
GraphQL IntroductionGraphQL Introduction
GraphQL Introduction
 
Modern APIs with GraphQL
Modern APIs with GraphQLModern APIs with GraphQL
Modern APIs with GraphQL
 
Getting started with GraphQL
Getting started with GraphQLGetting started with GraphQL
Getting started with GraphQL
 
Tutorial: Building a GraphQL API in PHP
Tutorial: Building a GraphQL API in PHPTutorial: Building a GraphQL API in PHP
Tutorial: Building a GraphQL API in PHP
 
Building a GraphQL API in PHP
Building a GraphQL API in PHPBuilding a GraphQL API in PHP
Building a GraphQL API in PHP
 
The Apollo and GraphQL Stack
The Apollo and GraphQL StackThe Apollo and GraphQL Stack
The Apollo and GraphQL Stack
 
GraphQL across the stack: How everything fits together
GraphQL across the stack: How everything fits togetherGraphQL across the stack: How everything fits together
GraphQL across the stack: How everything fits together
 

Similar to GraphQL

GraphQL API Gateway and microservices
GraphQL API Gateway and microservicesGraphQL API Gateway and microservices
GraphQL API Gateway and microservicesMohammed Shaban
 
GraphQL with .NET Core Microservices.pdf
GraphQL with .NET Core Microservices.pdfGraphQL with .NET Core Microservices.pdf
GraphQL with .NET Core Microservices.pdfKnoldus Inc.
 
GraphQL and its schema as a universal layer for database access
GraphQL and its schema as a universal layer for database accessGraphQL and its schema as a universal layer for database access
GraphQL and its schema as a universal layer for database accessConnected Data World
 
How easy (or hard) it is to monitor your graph ql service performance
How easy (or hard) it is to monitor your graph ql service performanceHow easy (or hard) it is to monitor your graph ql service performance
How easy (or hard) it is to monitor your graph ql service performanceLuca Mattia Ferrari
 
GraphQL - A query language to empower your API consumers (NDC Sydney 2017)
GraphQL - A query language to empower your API consumers (NDC Sydney 2017)GraphQL - A query language to empower your API consumers (NDC Sydney 2017)
GraphQL - A query language to empower your API consumers (NDC Sydney 2017)Rob Crowley
 
Simplify Access to Data from Pivotal GemFire Using the GraphQL (G2QL) Extension
Simplify Access to Data from Pivotal GemFire Using the GraphQL (G2QL) ExtensionSimplify Access to Data from Pivotal GemFire Using the GraphQL (G2QL) Extension
Simplify Access to Data from Pivotal GemFire Using the GraphQL (G2QL) ExtensionVMware Tanzu
 
CONDG April 23 2020 - Baskar Rao - GraphQL
CONDG April 23 2020 - Baskar Rao - GraphQLCONDG April 23 2020 - Baskar Rao - GraphQL
CONDG April 23 2020 - Baskar Rao - GraphQLMatthew Groves
 
APIdays Helsinki 2019 - GraphQL API Management with Amit P. Acharya, IBM
APIdays Helsinki 2019 - GraphQL API Management with Amit P. Acharya, IBMAPIdays Helsinki 2019 - GraphQL API Management with Amit P. Acharya, IBM
APIdays Helsinki 2019 - GraphQL API Management with Amit P. Acharya, IBMapidays
 
Real Time Serverless Polling App
Real Time Serverless Polling AppReal Time Serverless Polling App
Real Time Serverless Polling AppSrushith Repakula
 
APIdays Helsinki 2019 - Beyond REST: GraphQL API Management with Amit Acharya...
APIdays Helsinki 2019 - Beyond REST: GraphQL API Management with Amit Acharya...APIdays Helsinki 2019 - Beyond REST: GraphQL API Management with Amit Acharya...
APIdays Helsinki 2019 - Beyond REST: GraphQL API Management with Amit Acharya...apidays
 
Graphql for Frontend Developers Simplifying Data Fetching.docx
Graphql for Frontend Developers Simplifying Data Fetching.docxGraphql for Frontend Developers Simplifying Data Fetching.docx
Graphql for Frontend Developers Simplifying Data Fetching.docxssuser5583681
 
Scaling your GraphQL applications with Dgraph
Scaling your GraphQL applications with DgraphScaling your GraphQL applications with Dgraph
Scaling your GraphQL applications with DgraphKarthic Rao
 
How to provide a GraphQL API - I want it that way
How to provide a GraphQL API - I want it that wayHow to provide a GraphQL API - I want it that way
How to provide a GraphQL API - I want it that wayQAware GmbH
 
What could go wrong with a GraphQL query and can OpenTelemetry help? KubeCon...
What could go wrong  with a GraphQL query and can OpenTelemetry help? KubeCon...What could go wrong  with a GraphQL query and can OpenTelemetry help? KubeCon...
What could go wrong with a GraphQL query and can OpenTelemetry help? KubeCon...SonjaChevre
 
GraphQL & DGraph with Go
GraphQL & DGraph with GoGraphQL & DGraph with Go
GraphQL & DGraph with GoJames Tan
 
DEVOXX UK 2018 - GraphQL as an alternative approach to REST
DEVOXX UK 2018 - GraphQL as an alternative approach to RESTDEVOXX UK 2018 - GraphQL as an alternative approach to REST
DEVOXX UK 2018 - GraphQL as an alternative approach to RESTluisw19
 
GraphQL the holy contract between client and server
GraphQL the holy contract between client and serverGraphQL the holy contract between client and server
GraphQL the holy contract between client and serverPavel Chertorogov
 
GraphQL Federation, the missing piece of microservices
GraphQL Federation, the missing piece of microservicesGraphQL Federation, the missing piece of microservices
GraphQL Federation, the missing piece of microservicesNguyễn Quang Huy
 
GraphQL & Prisma from Scratch
GraphQL & Prisma from ScratchGraphQL & Prisma from Scratch
GraphQL & Prisma from ScratchNikolas Burk
 
Introduction to GraphQL Presentation.pptx
Introduction to GraphQL Presentation.pptxIntroduction to GraphQL Presentation.pptx
Introduction to GraphQL Presentation.pptxKnoldus Inc.
 

Similar to GraphQL (20)

GraphQL API Gateway and microservices
GraphQL API Gateway and microservicesGraphQL API Gateway and microservices
GraphQL API Gateway and microservices
 
GraphQL with .NET Core Microservices.pdf
GraphQL with .NET Core Microservices.pdfGraphQL with .NET Core Microservices.pdf
GraphQL with .NET Core Microservices.pdf
 
GraphQL and its schema as a universal layer for database access
GraphQL and its schema as a universal layer for database accessGraphQL and its schema as a universal layer for database access
GraphQL and its schema as a universal layer for database access
 
How easy (or hard) it is to monitor your graph ql service performance
How easy (or hard) it is to monitor your graph ql service performanceHow easy (or hard) it is to monitor your graph ql service performance
How easy (or hard) it is to monitor your graph ql service performance
 
GraphQL - A query language to empower your API consumers (NDC Sydney 2017)
GraphQL - A query language to empower your API consumers (NDC Sydney 2017)GraphQL - A query language to empower your API consumers (NDC Sydney 2017)
GraphQL - A query language to empower your API consumers (NDC Sydney 2017)
 
Simplify Access to Data from Pivotal GemFire Using the GraphQL (G2QL) Extension
Simplify Access to Data from Pivotal GemFire Using the GraphQL (G2QL) ExtensionSimplify Access to Data from Pivotal GemFire Using the GraphQL (G2QL) Extension
Simplify Access to Data from Pivotal GemFire Using the GraphQL (G2QL) Extension
 
CONDG April 23 2020 - Baskar Rao - GraphQL
CONDG April 23 2020 - Baskar Rao - GraphQLCONDG April 23 2020 - Baskar Rao - GraphQL
CONDG April 23 2020 - Baskar Rao - GraphQL
 
APIdays Helsinki 2019 - GraphQL API Management with Amit P. Acharya, IBM
APIdays Helsinki 2019 - GraphQL API Management with Amit P. Acharya, IBMAPIdays Helsinki 2019 - GraphQL API Management with Amit P. Acharya, IBM
APIdays Helsinki 2019 - GraphQL API Management with Amit P. Acharya, IBM
 
Real Time Serverless Polling App
Real Time Serverless Polling AppReal Time Serverless Polling App
Real Time Serverless Polling App
 
APIdays Helsinki 2019 - Beyond REST: GraphQL API Management with Amit Acharya...
APIdays Helsinki 2019 - Beyond REST: GraphQL API Management with Amit Acharya...APIdays Helsinki 2019 - Beyond REST: GraphQL API Management with Amit Acharya...
APIdays Helsinki 2019 - Beyond REST: GraphQL API Management with Amit Acharya...
 
Graphql for Frontend Developers Simplifying Data Fetching.docx
Graphql for Frontend Developers Simplifying Data Fetching.docxGraphql for Frontend Developers Simplifying Data Fetching.docx
Graphql for Frontend Developers Simplifying Data Fetching.docx
 
Scaling your GraphQL applications with Dgraph
Scaling your GraphQL applications with DgraphScaling your GraphQL applications with Dgraph
Scaling your GraphQL applications with Dgraph
 
How to provide a GraphQL API - I want it that way
How to provide a GraphQL API - I want it that wayHow to provide a GraphQL API - I want it that way
How to provide a GraphQL API - I want it that way
 
What could go wrong with a GraphQL query and can OpenTelemetry help? KubeCon...
What could go wrong  with a GraphQL query and can OpenTelemetry help? KubeCon...What could go wrong  with a GraphQL query and can OpenTelemetry help? KubeCon...
What could go wrong with a GraphQL query and can OpenTelemetry help? KubeCon...
 
GraphQL & DGraph with Go
GraphQL & DGraph with GoGraphQL & DGraph with Go
GraphQL & DGraph with Go
 
DEVOXX UK 2018 - GraphQL as an alternative approach to REST
DEVOXX UK 2018 - GraphQL as an alternative approach to RESTDEVOXX UK 2018 - GraphQL as an alternative approach to REST
DEVOXX UK 2018 - GraphQL as an alternative approach to REST
 
GraphQL the holy contract between client and server
GraphQL the holy contract between client and serverGraphQL the holy contract between client and server
GraphQL the holy contract between client and server
 
GraphQL Federation, the missing piece of microservices
GraphQL Federation, the missing piece of microservicesGraphQL Federation, the missing piece of microservices
GraphQL Federation, the missing piece of microservices
 
GraphQL & Prisma from Scratch
GraphQL & Prisma from ScratchGraphQL & Prisma from Scratch
GraphQL & Prisma from Scratch
 
Introduction to GraphQL Presentation.pptx
Introduction to GraphQL Presentation.pptxIntroduction to GraphQL Presentation.pptx
Introduction to GraphQL Presentation.pptx
 

More from Deepak Shevani

Intro to Azure Machine Learning
Intro to Azure Machine LearningIntro to Azure Machine Learning
Intro to Azure Machine LearningDeepak Shevani
 
EmergingTrendsInComputingAndProgrammingLanguages
EmergingTrendsInComputingAndProgrammingLanguagesEmergingTrendsInComputingAndProgrammingLanguages
EmergingTrendsInComputingAndProgrammingLanguagesDeepak Shevani
 
Enterprise build tool gradle
Enterprise build tool gradleEnterprise build tool gradle
Enterprise build tool gradleDeepak Shevani
 
Java 8-streams-and-parallelism
Java 8-streams-and-parallelismJava 8-streams-and-parallelism
Java 8-streams-and-parallelismDeepak Shevani
 
Moving towards Reactive Programming
Moving towards Reactive ProgrammingMoving towards Reactive Programming
Moving towards Reactive ProgrammingDeepak Shevani
 
Deepak semantic web_iitd
Deepak semantic web_iitdDeepak semantic web_iitd
Deepak semantic web_iitdDeepak Shevani
 

More from Deepak Shevani (7)

Intro to Azure Machine Learning
Intro to Azure Machine LearningIntro to Azure Machine Learning
Intro to Azure Machine Learning
 
EmergingTrendsInComputingAndProgrammingLanguages
EmergingTrendsInComputingAndProgrammingLanguagesEmergingTrendsInComputingAndProgrammingLanguages
EmergingTrendsInComputingAndProgrammingLanguages
 
Enterprise build tool gradle
Enterprise build tool gradleEnterprise build tool gradle
Enterprise build tool gradle
 
Java 8-streams-and-parallelism
Java 8-streams-and-parallelismJava 8-streams-and-parallelism
Java 8-streams-and-parallelism
 
Moving towards Reactive Programming
Moving towards Reactive ProgrammingMoving towards Reactive Programming
Moving towards Reactive Programming
 
Deepak semantic web_iitd
Deepak semantic web_iitdDeepak semantic web_iitd
Deepak semantic web_iitd
 
Yahoo! Time Traveler
Yahoo! Time TravelerYahoo! Time Traveler
Yahoo! Time Traveler
 

Recently uploaded

MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 

Recently uploaded (20)

MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 

GraphQL

  • 1. Graph QL By - Deepak Shevani
  • 2. Hello !! I am Deepak Shevani - Work at Microsoft for Azure group - Recently got interested in GraphQL - Contact : shevanideepak@gmail.com
  • 4. History of Web Services 4 1960 1990 2000 2018 RPC SOAP REST GRAPHQL
  • 5. REST Drawbacks ▧ Client Options : Http Verbs (GET, PUT, POST) ▧ Resources : /users /users/1 /users/1/posts ▧ No control over which fields to select ▧ Versioning of APIs is painful ▧ Overfetching / Underfetching ▧ Managing multiple endpoints is headache ▧ Change Process hindering agility 5
  • 6. GraphQL origins ? ▧ In 2012, FB decided to rebuild native apps ▧ FB then used RESTful services & FQL ▧ Idea : Improving client server communication ▧ Result : In 2015, open sourced GraphQL ▧ Also provided reference implementation (js) 6
  • 7. 1. What is GraphQL ? Will it kill REST ? 7
  • 8. 1000 foot view 8 Query Data Communication Medium
  • 11. Meet GraphQL QUERY LANGUAGE GraphQL defines query language and query is validated against type system which is blueprint for API Data SERVER SIDE RUNTIME GraphQL provides server side runtime to parse and route queries to fetch desired data for the caller More info about GraphQL can be found at http://graphql.org/learn 11 STRONGLY TYPED GraphQL allows you to do domain first design that generates types and schema CLIENT CENTRIC GraphQL has developer centric view biased towards clients
  • 12. Meet GraphQL QUERY LANGUAGE GraphQL defines query language and query is validated against type system which is blueprint for API Data SERVER SIDE RUNTIME GraphQL provides server side runtime to parse and route queries to fetch desired data for the caller More info about GraphQL can be found at http://graphql.org/learn 12 STRONGLY TYPED GraphQL allows you to do domain first design that generates types and schema CLIENT CENTRIC GraphQL has developer centric view biased towards clients
  • 13. What is GraphQL QUERY LANGUAGE GraphQL defines query language and query is validated against type system which is blueprint for API Data SERVER SIDE RUNTIME GraphQL provides server side runtime to parse and route queries to fetch desired data for the caller More info about GraphQL can be found at http://graphql.org/learn 13 STRONGLY TYPED GraphQL allows you to do domain first design that generates types and schema CLIENT CENTRIC GraphQL has developer centric view biased towards clients
  • 15. Example GraphQL Query 15 { employee (id: 35) { firstName lastName email } Resource Identifier Required Fields
  • 16. Example GraphQL Query 16 { employee (id: 35) { firstName lastName email } Resource Identifier Required Fields Id FirstName LastName Email DOB Salary Manager YOE 35 Deepak Shevani --- --- --- --- --- 36 Amit Sharma --- --- --- --- ---
  • 17. Example GraphQL Query 17 { employee (id: 35) { firstName lastName email } Resource Identifier Required Fields Id FirstName LastName Email DOB Salary Manager YOE 35 Deepak Shevani --- --- --- --- --- 36 Amit Sharma --- --- --- --- --- GET /api/employees/35
  • 18. Example GraphQL Query 18 { employee (id: 35) { firstName lastName email } { "employee" : { "firstName" : "Deepak", "lastName" : "Shevani", "email" : "abc@y.com" }
  • 19. Example GraphQL Query 19 { employee (id: 35) { firstName lastName email } Nothing more, nothing less !! Resolvers tells query where to go
  • 21. What is GraphQL QUERY LANGUAGE GraphQL defines query language and query is validated against type system which is blueprint for API Data SERVER SIDE RUNTIME GraphQL provides server side runtime to parse and route queries to fetch desired data for the caller More info about GraphQL can be found at http://graphql.org/learn 21 Queries Mutations Subscriptions Fragments Type System Validation Execution
  • 23. Queries Fetch data Describes what data you want to fetch from server. Response from server reflects what you ask in query (selection sets). We can create fragments to create reusable selection sets Query is GraphQL root type, as it maps to an operation Each field in selection set can have scalar or object type. Example fragment basicInfo on Employee { name email } query { employee (id : 35) { ... basicInfo } } More info about GraphQL can be found at http://graphql.org/learn 23
  • 25. GraphQL Operations 25 query GetTweets { allTweets { text user } } mutation Post ($body : String!) { addTweet (body : $body) { id } } Query Operation Mutation Operation variables : { body : "LSPE 15th" } variables : { body : "Loving it" }
  • 26. Mutations Update or Delete data Like queries, we could name them. We could also include selection sets to define return types Mutations are also root types, and they usually include variables Example mutation createSong($title:String! $one:Int) { addSong(title:$title, numberOne:$one) { id title numberOne } } More info about GraphQL can be found at http://graphql.org/learn 26
  • 28. Subscriptions Real time updates Using web sockets, you could listen to real time updates from the server At Facebook, the use case was to fetch real time likes on a page without getting refreshed Subscriptions are also root types Example subscription { liftStatusChange { name capacity status } } More info about GraphQL can be found at http://graphql.org/learn 28
  • 29. Query Language QUERY query { programs { name status } } FRAGMENTS fragment liftInfo on Lift { name status capacity night elevationGain } 29 MUTATIONS mutation { create(id: "program" status: OPEN) { name status } } SUBSCRIPTIONS subscription { liftStatusChange { name capacity status } }
  • 31. Benefits No Overfetching . No Underfetching Use queries . Easy deprecation Single Endpoint No custom endpoints
  • 34. Thanks! Any questions? You can find me at: @deepak_shevani shevanideepak@gmail.com 34