SlideShare a Scribd company logo
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
GraphqlGraphql
Graphql
Niv Ben David
 
GraphQL London January 2018: Graphql tooling
GraphQL London January 2018: Graphql toolingGraphQL London January 2018: Graphql tooling
GraphQL London January 2018: Graphql tooling
Søren Bramer Schmidt
 
GraphQL
GraphQLGraphQL
GraphQL
Joel Corrêa
 
GraphQL Advanced
GraphQL AdvancedGraphQL Advanced
GraphQL Advanced
LeanIX 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 tools
Sashko 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 REST
Yos Riady
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQL
Brainhub
 
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
 
GraphQL + relay
GraphQL + relayGraphQL + relay
GraphQL + relay
Cédric GILLET
 
Better APIs with GraphQL
Better APIs with GraphQL Better APIs with GraphQL
Better APIs with GraphQL
Josh Price
 
GraphQL & Relay
GraphQL & RelayGraphQL & Relay
GraphQL & Relay
Viacheslav Slinko
 
GraphQL Introduction
GraphQL IntroductionGraphQL Introduction
GraphQL Introduction
bobo52310
 
Modern APIs with GraphQL
Modern APIs with GraphQLModern APIs with GraphQL
Modern APIs with GraphQL
Taikai
 
Getting started with GraphQL
Getting started with GraphQLGetting started with GraphQL
Getting started with GraphQL
Thiago 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 PHP
Andrew Rota
 
Building a GraphQL API in PHP
Building a GraphQL API in PHPBuilding a GraphQL API in PHP
Building a GraphQL API in PHP
Andrew Rota
 
The Apollo and GraphQL Stack
The Apollo and GraphQL StackThe Apollo and GraphQL Stack
The Apollo and GraphQL Stack
Sashko 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 together
Sashko 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 microservices
Mohammed Shaban
 
GraphQL with .NET Core Microservices.pdf
GraphQL with .NET Core Microservices.pdfGraphQL with .NET Core Microservices.pdf
GraphQL with .NET Core Microservices.pdf
Knoldus 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 access
Connected 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 performance
Red Hat
 
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) Extension
VMware 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 - GraphQL
Matthew 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, IBM
apidays
 
Real Time Serverless Polling App
Real Time Serverless Polling AppReal Time Serverless Polling App
Real Time Serverless Polling App
Srushith 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.docx
ssuser5583681
 
Scaling your GraphQL applications with Dgraph
Scaling your GraphQL applications with DgraphScaling your GraphQL applications with Dgraph
Scaling your GraphQL applications with Dgraph
Karthic 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 way
QAware 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 Go
James 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 REST
luisw19
 
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
Pavel 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 microservices
Nguyễn Quang Huy
 
GraphQL & Prisma from Scratch
GraphQL & Prisma from ScratchGraphQL & Prisma from Scratch
GraphQL & Prisma from Scratch
Nikolas Burk
 
Introduction to GraphQL Presentation.pptx
Introduction to GraphQL Presentation.pptxIntroduction to GraphQL Presentation.pptx
Introduction to GraphQL Presentation.pptx
Knoldus 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 Learning
Deepak Shevani
 
EmergingTrendsInComputingAndProgrammingLanguages
EmergingTrendsInComputingAndProgrammingLanguagesEmergingTrendsInComputingAndProgrammingLanguages
EmergingTrendsInComputingAndProgrammingLanguages
Deepak Shevani
 
Enterprise build tool gradle
Enterprise build tool gradleEnterprise build tool gradle
Enterprise build tool gradle
Deepak Shevani
 
Java 8-streams-and-parallelism
Java 8-streams-and-parallelismJava 8-streams-and-parallelism
Java 8-streams-and-parallelism
Deepak Shevani
 
Moving towards Reactive Programming
Moving towards Reactive ProgrammingMoving towards Reactive Programming
Moving towards Reactive Programming
Deepak Shevani
 
Deepak semantic web_iitd
Deepak semantic web_iitdDeepak semantic web_iitd
Deepak semantic web_iitdDeepak Shevani
 
Yahoo! Time Traveler
Yahoo! Time TravelerYahoo! Time Traveler
Yahoo! Time Traveler
Deepak 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

AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
SupreethSP4
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 

Recently uploaded (20)

AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 

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