SlideShare a Scribd company logo
© 2021 GraphQL, Inc. Page | 1
GraphQL Fundamentals
© 2021 GraphQL.
.
Page | 2
Senior Software Engineer at BORN Group
Virbhadra S. Ankalkote
© 2021 GraphQL Page | 3
Agenda
© 2021 GraphQL Page | 4
Agenda
{
graphql:{
what
who
why
how
}
}
© 2021 GraphQL Page | 5
What ?
© 2021 GraphQL Page | 6
“GraphQL is a query language
for APIs, and a runtime for
fulfilling those queries with
existing data ”
© 2021 GraphQL Page | 7
Who ?
© 2021 GraphQL Page | 8
“In 2012, Facebook develop the
GraphQL technology for their
native mobile app”
.
© 2021 GraphQL Page | 9
.
2012 2015 2017..2018...2020
Development Started Open Source Evolving Specification.
Timeline
© 2021 GraphQL Page | 10
Why?
© 2021 GraphQL Page | 11
Application Programming Interface (API)
© 2021 GraphQL Page | 12
REST Flow
© 2021 GraphQL Page | 13
Principles of REST API Design
© 2021 GraphQL Page | 14
© 2021 GraphQL Page | 15
GraphQL Flow
© 2021 GraphQL Page | 16
© 2021 GraphQL Page | 17
Browser Tools
© 2021 GraphQL Page | 18
© 2021 GraphQL Page | 19
GraphQL Playground
© 2021 GraphQL Page | 20
How?
© 2021 GraphQL Page | 21
© 2021 GraphQL Page | 22
© 2021 GraphQL Page | 23
© 2021 GraphQL Page | 24
© 2021 GraphQL Page | 25
Limitations
© 2021 GraphQL Page | 26
© 2021 GraphQL Page | 27
Reading Data
© 2021 GraphQL Page | 28
© 2021 GraphQL Page | 29
© 2021 GraphQL Page | 30
© 2021 GraphQL Page | 31
© 2021 GraphQL Page | 32
Writing Data ( Mutation )
© 2021 GraphQL Page | 33
© 2021 GraphQL Page | 34
© 2021 GraphQL Page | 35
© 2021 GraphQL Page | 36
GraphQL Variables
© 2021 GraphQL Page | 37
• In GraphQL, you can use variables to reuse the same query/mutations written by
the client, with different arguments.
• When we start working with variables, we need to do three things:
– Replace the static value in the query with $variableName
– Declare $variableName as one of the variables accepted by the query
– Pass variableName: value in the separate, transport-specific (usually JSON)
variables dictionary
© 2021 GraphQL Page | 38
GraphQL Fragments
© 2021 GraphQL Page | 39
• A GraphQL fragment is a piece of logic that a client can share between multiple
queries and mutations.
• In GraphQL, you often need to query for the same data fields in different queries.
• By reusing this code, we can be more efficient with our time and reuse these piece
of queries
© 2021 GraphQL Page | 40
© 2021 GraphQL Page | 41
Pain Points of GraphQL
© 2021 GraphQL Page | 42
Almost impossible to solve
● Query In Indefinite Depth
– GraphQL cannot query in indefinite depth, so if you have a tree and want to
return a branch without knowing the depth, you’ll have to do some
pagination
● Specific Response Structure
– In GraphQL the response matches the shape of the query, so if you need to
respond in a very specific structure, you'll have to add a transformation layer
to reshape the response.
© 2021 GraphQL Page | 43
Hard to solve
● Cache at Network Level
– Because of the commonly way GraphQL is used over HTTP (A POST in a
single endpoint), cache at network level becomes hard. A way to solve it is to
use Persisted Queries.
● Handling File Upload
– There is nothing about file upload in the GraphQL specification and
mutations doesn’t accept files in the arguments. To solve it you can upload
files using other kind of APIs (like REST) and pass the URL of the uploaded file
to the GraphQL mutation, or inject the file in the execution context, so you’ll
have the file inside the resolver functions.
© 2021 GraphQL Page | 44
Questions ?
© 2021 GraphQL Page | 45
Thank You

More Related Content

What's hot (20)

PPTX
GraphQL Introduction
Serge Huber
 
PDF
Introduction to GraphQL
Sangeeta Ashrit
 
PDF
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
luisw19
 
PDF
REST vs GraphQL
Squareboat
 
PDF
Introduction to GraphQL (or How I Learned to Stop Worrying about REST APIs)
Hafiz Ismail
 
PDF
GraphQL
Joel Corrêa
 
PPTX
Intro GraphQL
Simona Cotin
 
PDF
Better APIs with GraphQL
Josh Price
 
PDF
React & GraphQL
Nikolas Burk
 
PPTX
Introduction to GraphQL Presentation.pptx
Knoldus Inc.
 
PDF
How to GraphQL
Tomasz Bak
 
PDF
GraphQL
Cédric GILLET
 
PDF
GraphQL vs REST
GreeceJS
 
ODP
Introduction to Swagger
Knoldus Inc.
 
PDF
gRPC and Microservices
Jonathan Gomez
 
PDF
The Apollo and GraphQL Stack
Sashko Stubailo
 
PPTX
API Docs with OpenAPI 3.0
Fabrizio Ferri-Benedetti
 
PPTX
Introducing Swagger
Tony Tam
 
PPTX
Spring Security 5
Jesus Perez Franco
 
GraphQL Introduction
Serge Huber
 
Introduction to GraphQL
Sangeeta Ashrit
 
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
luisw19
 
REST vs GraphQL
Squareboat
 
Introduction to GraphQL (or How I Learned to Stop Worrying about REST APIs)
Hafiz Ismail
 
GraphQL
Joel Corrêa
 
Intro GraphQL
Simona Cotin
 
Better APIs with GraphQL
Josh Price
 
React & GraphQL
Nikolas Burk
 
Introduction to GraphQL Presentation.pptx
Knoldus Inc.
 
How to GraphQL
Tomasz Bak
 
GraphQL vs REST
GreeceJS
 
Introduction to Swagger
Knoldus Inc.
 
gRPC and Microservices
Jonathan Gomez
 
The Apollo and GraphQL Stack
Sashko Stubailo
 
API Docs with OpenAPI 3.0
Fabrizio Ferri-Benedetti
 
Introducing Swagger
Tony Tam
 
Spring Security 5
Jesus Perez Franco
 

Similar to GraphQL Fundamentals (20)

PDF
Spring GraphQL
VMware Tanzu
 
PPTX
Magento2.3 - GraphQL introduction
Vishakha Borkar
 
PDF
The GraphQL Ecosystem in 2018
Nikolas Burk
 
DOCX
Graphql for Frontend Developers Simplifying Data Fetching.docx
ssuser5583681
 
PPTX
CONDG April 23 2020 - Baskar Rao - GraphQL
Matthew Groves
 
PPTX
Harnessing the Power of GraphQL in WordPress
Sandip Basnet
 
PDF
Modular GraphQL with Schema Stitching
Sashko Stubailo
 
PPTX
React Flux to GraphQL
Turadg Aleahmad
 
PPTX
GraphQL-ify your APIs - Devoxx UK 2021
Soham Dasgupta
 
PDF
GraphQL across the stack: How everything fits together
Sashko Stubailo
 
PDF
GraphQL + relay
Cédric GILLET
 
PDF
Boosting Data Fetching in Turkish Apps with React Native and GraphQL
Shiv Technolabs Pvt. Ltd.
 
PDF
Scaling your GraphQL applications with Dgraph
Karthic Rao
 
PPTX
Redux vs GraphQL
Jordon McKoy
 
PDF
Boost your API with GraphQL
Jean-Francois James
 
PDF
How easy (or hard) it is to monitor your graph ql service performance
Red Hat
 
PDF
Testing and Developing GraphQL APIs
Postman
 
PPTX
GraphQL research summary
Objectivity
 
PDF
Boost your APIs with GraphQL 1.0
Otávio Santana
 
PDF
Dubai Dreamin '24 - Exploring the Power of Salesforce GraphQL
Tarandeep Singh
 
Spring GraphQL
VMware Tanzu
 
Magento2.3 - GraphQL introduction
Vishakha Borkar
 
The GraphQL Ecosystem in 2018
Nikolas Burk
 
Graphql for Frontend Developers Simplifying Data Fetching.docx
ssuser5583681
 
CONDG April 23 2020 - Baskar Rao - GraphQL
Matthew Groves
 
Harnessing the Power of GraphQL in WordPress
Sandip Basnet
 
Modular GraphQL with Schema Stitching
Sashko Stubailo
 
React Flux to GraphQL
Turadg Aleahmad
 
GraphQL-ify your APIs - Devoxx UK 2021
Soham Dasgupta
 
GraphQL across the stack: How everything fits together
Sashko Stubailo
 
GraphQL + relay
Cédric GILLET
 
Boosting Data Fetching in Turkish Apps with React Native and GraphQL
Shiv Technolabs Pvt. Ltd.
 
Scaling your GraphQL applications with Dgraph
Karthic Rao
 
Redux vs GraphQL
Jordon McKoy
 
Boost your API with GraphQL
Jean-Francois James
 
How easy (or hard) it is to monitor your graph ql service performance
Red Hat
 
Testing and Developing GraphQL APIs
Postman
 
GraphQL research summary
Objectivity
 
Boost your APIs with GraphQL 1.0
Otávio Santana
 
Dubai Dreamin '24 - Exploring the Power of Salesforce GraphQL
Tarandeep Singh
 
Ad

Recently uploaded (20)

PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PPT
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PPTX
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Ad

GraphQL Fundamentals

  • 1. © 2021 GraphQL, Inc. Page | 1 GraphQL Fundamentals
  • 2. © 2021 GraphQL. . Page | 2 Senior Software Engineer at BORN Group Virbhadra S. Ankalkote
  • 3. © 2021 GraphQL Page | 3 Agenda
  • 4. © 2021 GraphQL Page | 4 Agenda { graphql:{ what who why how } }
  • 5. © 2021 GraphQL Page | 5 What ?
  • 6. © 2021 GraphQL Page | 6 “GraphQL is a query language for APIs, and a runtime for fulfilling those queries with existing data ”
  • 7. © 2021 GraphQL Page | 7 Who ?
  • 8. © 2021 GraphQL Page | 8 “In 2012, Facebook develop the GraphQL technology for their native mobile app” .
  • 9. © 2021 GraphQL Page | 9 . 2012 2015 2017..2018...2020 Development Started Open Source Evolving Specification. Timeline
  • 10. © 2021 GraphQL Page | 10 Why?
  • 11. © 2021 GraphQL Page | 11 Application Programming Interface (API)
  • 12. © 2021 GraphQL Page | 12 REST Flow
  • 13. © 2021 GraphQL Page | 13 Principles of REST API Design
  • 14. © 2021 GraphQL Page | 14
  • 15. © 2021 GraphQL Page | 15 GraphQL Flow
  • 16. © 2021 GraphQL Page | 16
  • 17. © 2021 GraphQL Page | 17 Browser Tools
  • 18. © 2021 GraphQL Page | 18
  • 19. © 2021 GraphQL Page | 19 GraphQL Playground
  • 20. © 2021 GraphQL Page | 20 How?
  • 21. © 2021 GraphQL Page | 21
  • 22. © 2021 GraphQL Page | 22
  • 23. © 2021 GraphQL Page | 23
  • 24. © 2021 GraphQL Page | 24
  • 25. © 2021 GraphQL Page | 25 Limitations
  • 26. © 2021 GraphQL Page | 26
  • 27. © 2021 GraphQL Page | 27 Reading Data
  • 28. © 2021 GraphQL Page | 28
  • 29. © 2021 GraphQL Page | 29
  • 30. © 2021 GraphQL Page | 30
  • 31. © 2021 GraphQL Page | 31
  • 32. © 2021 GraphQL Page | 32 Writing Data ( Mutation )
  • 33. © 2021 GraphQL Page | 33
  • 34. © 2021 GraphQL Page | 34
  • 35. © 2021 GraphQL Page | 35
  • 36. © 2021 GraphQL Page | 36 GraphQL Variables
  • 37. © 2021 GraphQL Page | 37 • In GraphQL, you can use variables to reuse the same query/mutations written by the client, with different arguments. • When we start working with variables, we need to do three things: – Replace the static value in the query with $variableName – Declare $variableName as one of the variables accepted by the query – Pass variableName: value in the separate, transport-specific (usually JSON) variables dictionary
  • 38. © 2021 GraphQL Page | 38 GraphQL Fragments
  • 39. © 2021 GraphQL Page | 39 • A GraphQL fragment is a piece of logic that a client can share between multiple queries and mutations. • In GraphQL, you often need to query for the same data fields in different queries. • By reusing this code, we can be more efficient with our time and reuse these piece of queries
  • 40. © 2021 GraphQL Page | 40
  • 41. © 2021 GraphQL Page | 41 Pain Points of GraphQL
  • 42. © 2021 GraphQL Page | 42 Almost impossible to solve ● Query In Indefinite Depth – GraphQL cannot query in indefinite depth, so if you have a tree and want to return a branch without knowing the depth, you’ll have to do some pagination ● Specific Response Structure – In GraphQL the response matches the shape of the query, so if you need to respond in a very specific structure, you'll have to add a transformation layer to reshape the response.
  • 43. © 2021 GraphQL Page | 43 Hard to solve ● Cache at Network Level – Because of the commonly way GraphQL is used over HTTP (A POST in a single endpoint), cache at network level becomes hard. A way to solve it is to use Persisted Queries. ● Handling File Upload – There is nothing about file upload in the GraphQL specification and mutations doesn’t accept files in the arguments. To solve it you can upload files using other kind of APIs (like REST) and pass the URL of the uploaded file to the GraphQL mutation, or inject the file in the execution context, so you’ll have the file inside the resolver functions.
  • 44. © 2021 GraphQL Page | 44 Questions ?
  • 45. © 2021 GraphQL Page | 45 Thank You