SlideShare a Scribd company logo
1 of 16
Introduction to
GraphQL
Presenter Name
Swapnil Dixit
Lack of etiquette and manners is a huge turn off.
KnolX Etiquettes
 Punctuality
Join the session 5 minutes prior to the session start time. We start on
time and conclude on time!
 Feedback
Make sure to submit a constructive feedback for all sessions as it is very
helpful for the presenter.
 Silent Mode
Keep your mobile devices in silent mode, feel free to move out of session
in case you need to attend an urgent call.
 Avoid Disturbance
Avoid unwanted chit chat during the session.
1. Introduction to GraphQL
2. Queries , Mutations & Subscriptions
3. SDL (Schema Definition language) ,
Runtime Environment & Query Language
4. Data Fetchers
5. How graphQL works in java
6. Difference between GraphQL & REST
7. Advantage & Disadvantages
8. Demo
GraphQL
 Official definition
GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing
data. GraphQL provides a complete and understandable description of the data in your API, gives
clients the power to ask for exactly what they need and nothing more.
 Important points from this definition:
GraphQL is a query language for APIs not a tool or a framework for designing APIs.
A client gets exactly what it wants from an API nothing more than that.
 In GraphQL, queries, mutations, and subscriptions are three types of operations that clients can
perform to interact with a GraphQL API
 In a single GraphQL request, queries, mutations, and subscriptions can be combined and
executed in parallel, improving efficiency
 GraphQL is a collection of three things:
SDL Schema definition language
Runtime Environment
Query Language
Queries , Mutations & Subscriptions
 Queries : Queries are used by clients to request data from the server. They are read-only operations,
meaning they do not modify data on the server.
Queries are used to retrieve data.
They specify the fields and nested data structures needed in the response.
Multiple queries can be combined into a single request for efficiency.
 Mutations : Mutations are used when clients need to modify data on the server. Unlike queries,
mutations can cause side effects on the server, such as creating, updating, or deleting data.
Mutations are used to modify or create data on the server.
They include an input object with the data to be modified or created.
Like queries, mutations can specify the fields needed in the response.
 Subscriptions : Subscriptions enable real-time communication between the server and the client.
Clients can subscribe to specific events, and the server will push updates to the client when those
events occur.
Subscriptions are used for real-time updates.
They define an event to subscribe to and the data structure to be sent when the event occurs.
Schema definition language(SDL)
 Schema definition language is used to define a GraphQL schema.
 A GraphQL schema is used to expose the functionalities that are available in an application to its
users. For ex: adding a new book to a virtual library or getting a list of all books from that library.
 A GraphQL schema contains:
■ Types which are similar to classes in Java.
■ Operations which can be performed on these Types. Similar to methods in Java.
type Query{ type Mutation{
getBook (id: Int) : Book createBook (name: String, pages: Int): Int
getBooks: [Book] }
} type Book{
id: Int
name: String
}
Runtime Environment
 Runtime environment performs two major operations:
Parsing the GraphQL schema file and creating an 'In memory schema' from it.
Executing the operation specified in the client's request.
 Parsing the GraphQL schema file
Reading information from the schema file again & again will be inefficient so the runtime
environment creates an Inmemory representation of the schema file that contains all the
information defined in that schema file.
 Executing the operation
A user can use any of the operations that were defined in the schema file. Runtime environment
is responsible for handling the user's request it looks for the operation specified in the request
then uses the inmemory schema to check if that operation exists in the schema or not. If it exists
then runtime will execute it and will perform the specified action like reading or manipulating the
data at server.
Query language(QL)
 Query language is used by clients to use operations that are defined in the GraphQL schema.
 QL enables a client to select only the required fields from a set of fields.
Data fetchers
 A data fetcher is a function associated with a specific field in the GraphQL schema. It's
responsible for fetching the data that corresponds to that field when a query is executed
 Each field in a GraphQL schema has an associated resolver function (data fetcher). Resolvers
are defined for each field in the schema, and they determine how the data for that field should be
obtained.
 When a GraphQL query is received by the server, the execution starts by invoking the data
fetcher for the root fields. These root data fetchers may, in turn, invoke other data fetchers for
nested fields.
 Data fetchers can accept arguments provided in the query to customize the data retrieval
process. These arguments are specified in the query and used by the data fetcher to fetch
relevant data.
 Data fetchers have access to a context object, which can store information shared across all
resolvers. This context object can contain data such as authentication details or database
connections.
 GraphQL clients often request the same data multiple times. Data fetchers can implement
caching strategies to optimize performance by avoiding redundant data fetches
Preparing In Memory Schema
How GraphQL works in java
GraphQL vs REST
GraphQL REST
Query Language Query language that allows clients to
request only the data they need,
including nested data and related
entities
Uses fixed endpoints that return
predefined data structures. Clients
have limited control over the shape
and size of the data they receive
Data Fetching Provides a single endpoint for all
interactions. Clients can specify the
structure of the response, avoiding
over-fetching and under-fetching
issues
Requires multiple endpoints for
different resources or views. Over-
fetching is common
Response Format Responses match the structure of the
query, and the server doesn't dictate
the response format. Clients can
request only the data they need
Responses are typically fixed, and any
changes require modifications to the
server. Different clients may need
different versions of the same resource
Discoverability: Introspective nature allows clients to
explore the schema and understand
available types, fields, and their
relationships.
Requires documentation to inform
clients about available endpoints,
methods, and data structures.
GraphQL Schema file
type Mutation{
createBook(book:BookInput):Book
}
type Query{
allBooks:[Book]
getBook(bookId:Int):Book
}
type Book{
id:ID!
title:String
desc:String
author:String
price:Float
pages:Int
}
input BookInput{
title:String
desc:String
author:String
price:Float
pages:Int
}
Advantage & Disadvantage of graphQL
 Efficient Data Retrieval - Allows clients to request
only the data they need, reducing over-fetching
and under-fetching of data
 Flexibility and Adaptability - Clients have fine-
grained control over the data they receive
 Single Endpoint - GraphQL APIs typically have a
single endpoint, simplifying the API structure
 Real-time Data with Subscriptions - GraphQL
supports real-time updates through subscriptions,
allowing clients to receive real-time data when it
changes on the server
 Strongly Typed Schema - GraphQL APIs are
defined by a strongly typed schema, which
provides clarity on the data structure and helps
catch errors during development
 Reduced Number of Requests
Advantage
 Security Considerations - GraphQL APIs can be
vulnerable to certain types of attacks, such as
malicious queries or denial-of-service attacks
 Caching Complexity Caching - In GraphQL can be
more challenging than in REST because clients
can request different subsets of data in each query
 Backend Complexity - Server can be more
complex than a REST API, especially when dealing
with complex queries
 Tooling Support - It has good tooling support,
but may not be as mature as the tooling available
for REST. Some development tools, libraries, and
frameworks have better support for RESTful APIs.
Disadvantage
DEMO
Introduction to GraphQL Presentation.pptx

More Related Content

Similar to Introduction to GraphQL Presentation.pptx

GraphQL research summary
GraphQL research summaryGraphQL research summary
GraphQL research summaryObjectivity
 
How to Deploy a GraphQL API A Comprehensive Guide.docx
How to Deploy a GraphQL API A Comprehensive Guide.docxHow to Deploy a GraphQL API A Comprehensive Guide.docx
How to Deploy a GraphQL API A Comprehensive Guide.docxssuser5583681
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQLRodrigo Prates
 
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
 
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
 
Graph ql vs rest api - Seven Peaks Software (Node.JS Meetup 18 nov 2021)
Graph ql vs rest api - Seven Peaks Software (Node.JS Meetup 18 nov 2021)Graph ql vs rest api - Seven Peaks Software (Node.JS Meetup 18 nov 2021)
Graph ql vs rest api - Seven Peaks Software (Node.JS Meetup 18 nov 2021)Seven Peaks Speaks
 
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
 
Graphql presentation
Graphql presentationGraphql presentation
Graphql presentationVibhor Grover
 
Modern APIs with GraphQL
Modern APIs with GraphQLModern APIs with GraphQL
Modern APIs with GraphQLTaikai
 
GraphQL Introduction with Spring Boot
GraphQL Introduction with Spring BootGraphQL Introduction with Spring Boot
GraphQL Introduction with Spring Bootvipin kumar
 
Pentest Application With GraphQL | Null Bangalore Meetup
Pentest Application With GraphQL | Null Bangalore Meetup Pentest Application With GraphQL | Null Bangalore Meetup
Pentest Application With GraphQL | Null Bangalore Meetup Divyanshu
 
GraphQL - A love story
GraphQL -  A love storyGraphQL -  A love story
GraphQL - A love storybwullems
 

Similar to Introduction to GraphQL Presentation.pptx (20)

Graphql
GraphqlGraphql
Graphql
 
Apollo Server
Apollo ServerApollo Server
Apollo Server
 
GraphQL research summary
GraphQL research summaryGraphQL research summary
GraphQL research summary
 
How to Deploy a GraphQL API A Comprehensive Guide.docx
How to Deploy a GraphQL API A Comprehensive Guide.docxHow to Deploy a GraphQL API A Comprehensive Guide.docx
How to Deploy a GraphQL API A Comprehensive Guide.docx
 
GraphQL
GraphQLGraphQL
GraphQL
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQL
 
GraphQL
GraphQLGraphQL
GraphQL
 
LeVan, "Search Web Services"
LeVan, "Search Web Services"LeVan, "Search Web Services"
LeVan, "Search Web Services"
 
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
 
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
 
Graph ql vs rest api - Seven Peaks Software (Node.JS Meetup 18 nov 2021)
Graph ql vs rest api - Seven Peaks Software (Node.JS Meetup 18 nov 2021)Graph ql vs rest api - Seven Peaks Software (Node.JS Meetup 18 nov 2021)
Graph ql vs rest api - Seven Peaks Software (Node.JS Meetup 18 nov 2021)
 
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
 
Graphql presentation
Graphql presentationGraphql presentation
Graphql presentation
 
Modern APIs with GraphQL
Modern APIs with GraphQLModern APIs with GraphQL
Modern APIs with GraphQL
 
GraphQL.pptx
GraphQL.pptxGraphQL.pptx
GraphQL.pptx
 
GraphQL.pptx
GraphQL.pptxGraphQL.pptx
GraphQL.pptx
 
GraphQL Introduction with Spring Boot
GraphQL Introduction with Spring BootGraphQL Introduction with Spring Boot
GraphQL Introduction with Spring Boot
 
GraphQL 101
GraphQL 101GraphQL 101
GraphQL 101
 
Pentest Application With GraphQL | Null Bangalore Meetup
Pentest Application With GraphQL | Null Bangalore Meetup Pentest Application With GraphQL | Null Bangalore Meetup
Pentest Application With GraphQL | Null Bangalore Meetup
 
GraphQL - A love story
GraphQL -  A love storyGraphQL -  A love story
GraphQL - A love story
 

More from Knoldus Inc.

Mastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML ParsingMastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML ParsingKnoldus Inc.
 
Akka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On IntroductionAkka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On IntroductionKnoldus Inc.
 
Entity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptxEntity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptxKnoldus Inc.
 
Introduction to Redis and its features.pptx
Introduction to Redis and its features.pptxIntroduction to Redis and its features.pptx
Introduction to Redis and its features.pptxKnoldus Inc.
 
NuGet Packages Presentation (DoT NeT).pptx
NuGet Packages Presentation (DoT NeT).pptxNuGet Packages Presentation (DoT NeT).pptx
NuGet Packages Presentation (DoT NeT).pptxKnoldus Inc.
 
Data Quality in Test Automation Navigating the Path to Reliable Testing
Data Quality in Test Automation Navigating the Path to Reliable TestingData Quality in Test Automation Navigating the Path to Reliable Testing
Data Quality in Test Automation Navigating the Path to Reliable TestingKnoldus Inc.
 
K8sGPTThe AI​ way to diagnose Kubernetes
K8sGPTThe AI​ way to diagnose KubernetesK8sGPTThe AI​ way to diagnose Kubernetes
K8sGPTThe AI​ way to diagnose KubernetesKnoldus Inc.
 
Introduction to Circle Ci Presentation.pptx
Introduction to Circle Ci Presentation.pptxIntroduction to Circle Ci Presentation.pptx
Introduction to Circle Ci Presentation.pptxKnoldus Inc.
 
Robusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptxRobusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptxKnoldus Inc.
 
Optimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptxOptimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptxKnoldus Inc.
 
Azure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptxAzure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptxKnoldus Inc.
 
CQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptxCQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptxKnoldus Inc.
 
ETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake PresentationETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake PresentationKnoldus Inc.
 
Scripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics PresentationScripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics PresentationKnoldus Inc.
 
Getting started with dotnet core Web APIs
Getting started with dotnet core Web APIsGetting started with dotnet core Web APIs
Getting started with dotnet core Web APIsKnoldus Inc.
 
Introduction To Rust part II Presentation
Introduction To Rust part II PresentationIntroduction To Rust part II Presentation
Introduction To Rust part II PresentationKnoldus Inc.
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Configuring Workflows & Validators in JIRA
Configuring Workflows & Validators in JIRAConfiguring Workflows & Validators in JIRA
Configuring Workflows & Validators in JIRAKnoldus Inc.
 
Advanced Python (with dependency injection and hydra configuration packages)
Advanced Python (with dependency injection and hydra configuration packages)Advanced Python (with dependency injection and hydra configuration packages)
Advanced Python (with dependency injection and hydra configuration packages)Knoldus Inc.
 
Azure Databricks (For Data Analytics).pptx
Azure Databricks (For Data Analytics).pptxAzure Databricks (For Data Analytics).pptx
Azure Databricks (For Data Analytics).pptxKnoldus Inc.
 

More from Knoldus Inc. (20)

Mastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML ParsingMastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
 
Akka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On IntroductionAkka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On Introduction
 
Entity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptxEntity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptx
 
Introduction to Redis and its features.pptx
Introduction to Redis and its features.pptxIntroduction to Redis and its features.pptx
Introduction to Redis and its features.pptx
 
NuGet Packages Presentation (DoT NeT).pptx
NuGet Packages Presentation (DoT NeT).pptxNuGet Packages Presentation (DoT NeT).pptx
NuGet Packages Presentation (DoT NeT).pptx
 
Data Quality in Test Automation Navigating the Path to Reliable Testing
Data Quality in Test Automation Navigating the Path to Reliable TestingData Quality in Test Automation Navigating the Path to Reliable Testing
Data Quality in Test Automation Navigating the Path to Reliable Testing
 
K8sGPTThe AI​ way to diagnose Kubernetes
K8sGPTThe AI​ way to diagnose KubernetesK8sGPTThe AI​ way to diagnose Kubernetes
K8sGPTThe AI​ way to diagnose Kubernetes
 
Introduction to Circle Ci Presentation.pptx
Introduction to Circle Ci Presentation.pptxIntroduction to Circle Ci Presentation.pptx
Introduction to Circle Ci Presentation.pptx
 
Robusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptxRobusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptx
 
Optimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptxOptimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptx
 
Azure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptxAzure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptx
 
CQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptxCQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptx
 
ETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake PresentationETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake Presentation
 
Scripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics PresentationScripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics Presentation
 
Getting started with dotnet core Web APIs
Getting started with dotnet core Web APIsGetting started with dotnet core Web APIs
Getting started with dotnet core Web APIs
 
Introduction To Rust part II Presentation
Introduction To Rust part II PresentationIntroduction To Rust part II Presentation
Introduction To Rust part II Presentation
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Configuring Workflows & Validators in JIRA
Configuring Workflows & Validators in JIRAConfiguring Workflows & Validators in JIRA
Configuring Workflows & Validators in JIRA
 
Advanced Python (with dependency injection and hydra configuration packages)
Advanced Python (with dependency injection and hydra configuration packages)Advanced Python (with dependency injection and hydra configuration packages)
Advanced Python (with dependency injection and hydra configuration packages)
 
Azure Databricks (For Data Analytics).pptx
Azure Databricks (For Data Analytics).pptxAzure Databricks (For Data Analytics).pptx
Azure Databricks (For Data Analytics).pptx
 

Recently uploaded

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 

Introduction to GraphQL Presentation.pptx

  • 2. Lack of etiquette and manners is a huge turn off. KnolX Etiquettes  Punctuality Join the session 5 minutes prior to the session start time. We start on time and conclude on time!  Feedback Make sure to submit a constructive feedback for all sessions as it is very helpful for the presenter.  Silent Mode Keep your mobile devices in silent mode, feel free to move out of session in case you need to attend an urgent call.  Avoid Disturbance Avoid unwanted chit chat during the session.
  • 3. 1. Introduction to GraphQL 2. Queries , Mutations & Subscriptions 3. SDL (Schema Definition language) , Runtime Environment & Query Language 4. Data Fetchers 5. How graphQL works in java 6. Difference between GraphQL & REST 7. Advantage & Disadvantages 8. Demo
  • 4. GraphQL  Official definition GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more.  Important points from this definition: GraphQL is a query language for APIs not a tool or a framework for designing APIs. A client gets exactly what it wants from an API nothing more than that.  In GraphQL, queries, mutations, and subscriptions are three types of operations that clients can perform to interact with a GraphQL API  In a single GraphQL request, queries, mutations, and subscriptions can be combined and executed in parallel, improving efficiency  GraphQL is a collection of three things: SDL Schema definition language Runtime Environment Query Language
  • 5. Queries , Mutations & Subscriptions  Queries : Queries are used by clients to request data from the server. They are read-only operations, meaning they do not modify data on the server. Queries are used to retrieve data. They specify the fields and nested data structures needed in the response. Multiple queries can be combined into a single request for efficiency.  Mutations : Mutations are used when clients need to modify data on the server. Unlike queries, mutations can cause side effects on the server, such as creating, updating, or deleting data. Mutations are used to modify or create data on the server. They include an input object with the data to be modified or created. Like queries, mutations can specify the fields needed in the response.  Subscriptions : Subscriptions enable real-time communication between the server and the client. Clients can subscribe to specific events, and the server will push updates to the client when those events occur. Subscriptions are used for real-time updates. They define an event to subscribe to and the data structure to be sent when the event occurs.
  • 6. Schema definition language(SDL)  Schema definition language is used to define a GraphQL schema.  A GraphQL schema is used to expose the functionalities that are available in an application to its users. For ex: adding a new book to a virtual library or getting a list of all books from that library.  A GraphQL schema contains: ■ Types which are similar to classes in Java. ■ Operations which can be performed on these Types. Similar to methods in Java. type Query{ type Mutation{ getBook (id: Int) : Book createBook (name: String, pages: Int): Int getBooks: [Book] } } type Book{ id: Int name: String }
  • 7. Runtime Environment  Runtime environment performs two major operations: Parsing the GraphQL schema file and creating an 'In memory schema' from it. Executing the operation specified in the client's request.  Parsing the GraphQL schema file Reading information from the schema file again & again will be inefficient so the runtime environment creates an Inmemory representation of the schema file that contains all the information defined in that schema file.  Executing the operation A user can use any of the operations that were defined in the schema file. Runtime environment is responsible for handling the user's request it looks for the operation specified in the request then uses the inmemory schema to check if that operation exists in the schema or not. If it exists then runtime will execute it and will perform the specified action like reading or manipulating the data at server.
  • 8. Query language(QL)  Query language is used by clients to use operations that are defined in the GraphQL schema.  QL enables a client to select only the required fields from a set of fields.
  • 9. Data fetchers  A data fetcher is a function associated with a specific field in the GraphQL schema. It's responsible for fetching the data that corresponds to that field when a query is executed  Each field in a GraphQL schema has an associated resolver function (data fetcher). Resolvers are defined for each field in the schema, and they determine how the data for that field should be obtained.  When a GraphQL query is received by the server, the execution starts by invoking the data fetcher for the root fields. These root data fetchers may, in turn, invoke other data fetchers for nested fields.  Data fetchers can accept arguments provided in the query to customize the data retrieval process. These arguments are specified in the query and used by the data fetcher to fetch relevant data.  Data fetchers have access to a context object, which can store information shared across all resolvers. This context object can contain data such as authentication details or database connections.  GraphQL clients often request the same data multiple times. Data fetchers can implement caching strategies to optimize performance by avoiding redundant data fetches
  • 11. How GraphQL works in java
  • 12. GraphQL vs REST GraphQL REST Query Language Query language that allows clients to request only the data they need, including nested data and related entities Uses fixed endpoints that return predefined data structures. Clients have limited control over the shape and size of the data they receive Data Fetching Provides a single endpoint for all interactions. Clients can specify the structure of the response, avoiding over-fetching and under-fetching issues Requires multiple endpoints for different resources or views. Over- fetching is common Response Format Responses match the structure of the query, and the server doesn't dictate the response format. Clients can request only the data they need Responses are typically fixed, and any changes require modifications to the server. Different clients may need different versions of the same resource Discoverability: Introspective nature allows clients to explore the schema and understand available types, fields, and their relationships. Requires documentation to inform clients about available endpoints, methods, and data structures.
  • 13. GraphQL Schema file type Mutation{ createBook(book:BookInput):Book } type Query{ allBooks:[Book] getBook(bookId:Int):Book } type Book{ id:ID! title:String desc:String author:String price:Float pages:Int } input BookInput{ title:String desc:String author:String price:Float pages:Int }
  • 14. Advantage & Disadvantage of graphQL  Efficient Data Retrieval - Allows clients to request only the data they need, reducing over-fetching and under-fetching of data  Flexibility and Adaptability - Clients have fine- grained control over the data they receive  Single Endpoint - GraphQL APIs typically have a single endpoint, simplifying the API structure  Real-time Data with Subscriptions - GraphQL supports real-time updates through subscriptions, allowing clients to receive real-time data when it changes on the server  Strongly Typed Schema - GraphQL APIs are defined by a strongly typed schema, which provides clarity on the data structure and helps catch errors during development  Reduced Number of Requests Advantage  Security Considerations - GraphQL APIs can be vulnerable to certain types of attacks, such as malicious queries or denial-of-service attacks  Caching Complexity Caching - In GraphQL can be more challenging than in REST because clients can request different subsets of data in each query  Backend Complexity - Server can be more complex than a REST API, especially when dealing with complex queries  Tooling Support - It has good tooling support, but may not be as mature as the tooling available for REST. Some development tools, libraries, and frameworks have better support for RESTful APIs. Disadvantage
  • 15. DEMO