SlideShare a Scribd company logo
2
Most read
5
Most read
8
Most read
Introduction to
GraphQL Testing
Shivam Singh (Software Consultant)
Test Automation Competency
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
• Example
• Working Architecture
2. What is GraphQL?
3. Why use GraphQL?
4. Rest Vs GraphQL
5. Components of GraphQL
6. Why GraphQL API is the perfect data layer for your backend
7. Why test GraphQL?
8. Advantages of GraphQL
9. Best Practices for GraphQL Testing
10. Effective testing approach in GraphQL
11. Testing GraphQL Tools
12. Demo/QnA
Introduction
Introduction
In the world of web development, there’s this powerful tool called GraphQL. It's like being your
own chef in a restaurant kitchen, where you can order precisely what you want and how you
want it. Let's take a peek at this cool way of getting data from the web, where you're in charge of
your data order, getting only what you need, just how you want it, and all from one place!
Let's Understand with an example:-
User
Id
Name
age
gender
Address
Id
Street
City
Country
Job
Id
Organization
Department
Join_Date
Salary
Id
Type
Pay
Tax
HomeScreen
Name
Department
City
SalaryPay
User
Id
Name
age
gender
Address
Id
Street
City
Country
Job
Id
Organization
Department
Join_Date
Salary
Id
Type
Pay
Tax
HomeScreen
Name
Department
City
SalaryPay
Database
Legacy
System
GRAPHQL
Query to single GraphQL End
point asking exactly detail you
need
What is GraphQL ?
• GraphQL is a query language and server-side runtime
for fulfilling those queries on your existing data.
• GraphQL isn't tied to any specific database or
storage engine and is instead backed by your existing
code and data.
• GraphQL was developed by Facebook in 2012 . After
that, it was publicly released in 2015 at the
React.js conference.
• It was developed to optimize RESTful API calls and
provides a flexible, robust, and more efficient
alternative to REST.
Why use GraphQL ?
• We already had an API named REST for data communication, which follows a clear and well-structured resource-
oriented approach.
• It also provides some great ideas such as stateless servers, structured access to resources, etc.
• REST is not so flexible to cope up with the rapidly changing requirements of the clients that access them.
• In this case, when the data gets more complex, the routes get longer. Sometimes, it is challenging to fetch the
data with a single request. That's why we use GraphQL.
Rest vs GraphQL
Mutation
Type Query
type Query{
user(id: ID): User
department(id: ID): Dept
users: [User]
dept: [Depatment]
}
type Mutation {
AddUser(name: String)
AddDepart(name: String)
}
type User{
id:String!
name:String!
age:Int
Address:String
}
Components of GraphQL
Resolvers
User: {
type: UserType,
args: {id: {type: GraphQLID}},
resolve(parent, args){
return Movie.findById(args.id);
}
}
Query in GraphQL
• In simple terms, queries are ways to get data from the server. No more over or under
fetching, you get what exactly you ask. It is a read-only fetch operation.
• In the REST world, queries are equivalent to how you’d use Request with a payload to
get a response from the server.
Example:-
• the schema allows the users to query for four different types of data:
• A Book with a valid ID.
• An Author with a valid ID.
• To fetch all the Books, that returns a data type LIST.
• To fetch all the Authors, that returns a data type LIST.
type Query {
book(id: int): Books
author(id: int): Authors
books:[Books]
author: [Authors]
}
Mutation in GraphQL
• The mutations are equivalent to how you’d use the CRUD operation
along with Verbs such as GET, POST, PUT, PATCH and DELETE in the
REST world.
• In GraphQL, It will always be a POST call. It's a write followed by fetch
operation.
Example:-
See the two mutations that are shown for Adding a Book that should return
a new Book for us and Add Author that should return a new Author:
type Mutation {
addBook(name: String!, authorId: int): Books
addAuthor(name: String!): Author
}
Why GraphQL API Is The Perfect Data Layer For Your Backend
• One unified endpoint for your backend
• Improved application performance
• Improved system reliability
• Better developer experience
Why Test GraphQL?
• Schema Changes: Ensure modifications to the API schema don't break
existing functionality.
• Functional Validation: Confirm that queries, mutations, and subscriptions
return expected results and perform desired operations.
• Performance Assurance: Assess API performance under complex
queries and data loads.
• Security Checks: Identify and fix vulnerabilities like injection attacks,
unauthorized access, and data exposure.
• Error Handling: Verify graceful error handling, ensuring informative
responses for clients.
Why
Advantages of GraphQL
• GraphQL is faster.
• No over-fetching and under-fetching problems
• Hierarchical Structure
• Defines a data shape
• Strongly typed
02
01
Best practices To Test GraphQL
03
• Empty arrays
• Maximum/minimum values
• Invalid query handling
• Authentication failures
• Authorization denials
Edge Cases and Error
04
• Missing required fields
• Incorrect argument types
• Violating custom validations
• Field-level validations
• Input object validations
Query and Mutation
• Concurrent request handling
• Response time evaluation
• Batched query performance
• Caching effectiveness
Performance and Load
• Authenticated and unauthenticated requests
• Valid and invalid tokens
• Different user roles and permissions
• Accessing restricted resources
Test Authentication
Testing GraphQL Tools
Effective testing approach in
GraphQL
GraphQL Explorer (GraphiQL)
Test GraphQL on Postman
DEMO
Q&A
Introduction to Testing GraphQL Presentation

More Related Content

PDF
Agile Team Working Agreements
PPT
Basic Presentation Skills
PDF
Creating a Product Vision
PPTX
Scrum Learning Game: Elephant Carpaccio
PDF
04 presentation skills
PPTX
AgileBVIR
PPTX
Designing & delivering business presentation
PPTX
V model in software testing
Agile Team Working Agreements
Basic Presentation Skills
Creating a Product Vision
Scrum Learning Game: Elephant Carpaccio
04 presentation skills
AgileBVIR
Designing & delivering business presentation
V model in software testing

What's hot (16)

PPTX
Evidenced based management - Presentation at Scrum Australia 24 oct 2018
PPTX
8 elements for making a good presentation
PPT
Writing Effective User Stories
PPTX
My first experience with robotics by using mBot
PPT
Agile methodology
PPTX
Business Process Monitoring and Mining
PDF
Agile Metrics for Senior Managers and Executives
PPTX
How to take organizations to higher testing maturity suresh bose anagha mahaj...
PPTX
AMC presentation
PPTX
Coaching People to Be Like You? Here's Why That's a Big Mistake.
PPTX
Architecture Review
PPT
Agile project management PMI-ACP
PPT
Guidelines on Developing Effective PowerPoint Presentation
POTX
Product Roadmap Template
PDF
Agile testing principles and practices - Anil Karade
PPTX
Air traffic controller - Streams Processing meetup
Evidenced based management - Presentation at Scrum Australia 24 oct 2018
8 elements for making a good presentation
Writing Effective User Stories
My first experience with robotics by using mBot
Agile methodology
Business Process Monitoring and Mining
Agile Metrics for Senior Managers and Executives
How to take organizations to higher testing maturity suresh bose anagha mahaj...
AMC presentation
Coaching People to Be Like You? Here's Why That's a Big Mistake.
Architecture Review
Agile project management PMI-ACP
Guidelines on Developing Effective PowerPoint Presentation
Product Roadmap Template
Agile testing principles and practices - Anil Karade
Air traffic controller - Streams Processing meetup
Ad

Similar to Introduction to Testing GraphQL Presentation (20)

PPT
Graphql presentation
PDF
GraphQL over REST at Reactathon 2018
PDF
GraphQL with .NET Core Microservices.pdf
PPTX
GraphQL Introduction with Spring Boot
PPTX
Introduction to Graph QL
PPTX
GraphQL research summary
PDF
PDF
Why UI Developers Love GraphQL - Sashko Stubailo, Apollo/Meteor
PDF
Why UI developers love GraphQL
PDF
PDF
Introduction to GraphQL
PPTX
GraphQL API Gateway and microservices
PPTX
Introduction to GraphQL
PDF
GraphQL- Presentation
PDF
Graphql
PPTX
GraphQL - an elegant weapon... for more civilized age
PDF
REST to GraphQL migration: Pros, cons and gotchas
PDF
Modern APIs with GraphQL
PDF
React and GraphQL at Stripe
PDF
Introduction to GraphQL for beginners
Graphql presentation
GraphQL over REST at Reactathon 2018
GraphQL with .NET Core Microservices.pdf
GraphQL Introduction with Spring Boot
Introduction to Graph QL
GraphQL research summary
Why UI Developers Love GraphQL - Sashko Stubailo, Apollo/Meteor
Why UI developers love GraphQL
Introduction to GraphQL
GraphQL API Gateway and microservices
Introduction to GraphQL
GraphQL- Presentation
Graphql
GraphQL - an elegant weapon... for more civilized age
REST to GraphQL migration: Pros, cons and gotchas
Modern APIs with GraphQL
React and GraphQL at Stripe
Introduction to GraphQL for beginners
Ad

More from Knoldus Inc. (20)

PPTX
Angular Hydration Presentation (FrontEnd)
PPTX
Optimizing Test Execution: Heuristic Algorithm for Self-Healing
PPTX
Self-Healing Test Automation Framework - Healenium
PPTX
Kanban Metrics Presentation (Project Management)
PPTX
Java 17 features and implementation.pptx
PPTX
Chaos Mesh Introducing Chaos in Kubernetes
PPTX
GraalVM - A Step Ahead of JVM Presentation
PPTX
Nomad by HashiCorp Presentation (DevOps)
PPTX
Nomad by HashiCorp Presentation (DevOps)
PPTX
DAPR - Distributed Application Runtime Presentation
PPTX
Introduction to Azure Virtual WAN Presentation
PPTX
Introduction to Argo Rollouts Presentation
PPTX
Intro to Azure Container App Presentation
PPTX
Insights Unveiled Test Reporting and Observability Excellence
PPTX
Introduction to Splunk Presentation (DevOps)
PPTX
Code Camp - Data Profiling and Quality Analysis Framework
PPTX
AWS: Messaging Services in AWS Presentation
PPTX
Amazon Cognito: A Primer on Authentication and Authorization
PPTX
ZIO Http A Functional Approach to Scalable and Type-Safe Web Development
PPTX
Managing State & HTTP Requests In Ionic.
Angular Hydration Presentation (FrontEnd)
Optimizing Test Execution: Heuristic Algorithm for Self-Healing
Self-Healing Test Automation Framework - Healenium
Kanban Metrics Presentation (Project Management)
Java 17 features and implementation.pptx
Chaos Mesh Introducing Chaos in Kubernetes
GraalVM - A Step Ahead of JVM Presentation
Nomad by HashiCorp Presentation (DevOps)
Nomad by HashiCorp Presentation (DevOps)
DAPR - Distributed Application Runtime Presentation
Introduction to Azure Virtual WAN Presentation
Introduction to Argo Rollouts Presentation
Intro to Azure Container App Presentation
Insights Unveiled Test Reporting and Observability Excellence
Introduction to Splunk Presentation (DevOps)
Code Camp - Data Profiling and Quality Analysis Framework
AWS: Messaging Services in AWS Presentation
Amazon Cognito: A Primer on Authentication and Authorization
ZIO Http A Functional Approach to Scalable and Type-Safe Web Development
Managing State & HTTP Requests In Ionic.

Recently uploaded (20)

PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPT
Teaching material agriculture food technology
PDF
cuic standard and advanced reporting.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Big Data Technologies - Introduction.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Empathic Computing: Creating Shared Understanding
PDF
Spectral efficient network and resource selection model in 5G networks
Building Integrated photovoltaic BIPV_UPV.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Teaching material agriculture food technology
cuic standard and advanced reporting.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Big Data Technologies - Introduction.pptx
Network Security Unit 5.pdf for BCA BBA.
Digital-Transformation-Roadmap-for-Companies.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
MYSQL Presentation for SQL database connectivity
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Reach Out and Touch Someone: Haptics and Empathic Computing
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
NewMind AI Weekly Chronicles - August'25 Week I
20250228 LYD VKU AI Blended-Learning.pptx
Empathic Computing: Creating Shared Understanding
Spectral efficient network and resource selection model in 5G networks

Introduction to Testing GraphQL Presentation

  • 1. Introduction to GraphQL Testing Shivam Singh (Software Consultant) Test Automation Competency
  • 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 • Example • Working Architecture 2. What is GraphQL? 3. Why use GraphQL? 4. Rest Vs GraphQL 5. Components of GraphQL 6. Why GraphQL API is the perfect data layer for your backend 7. Why test GraphQL? 8. Advantages of GraphQL 9. Best Practices for GraphQL Testing 10. Effective testing approach in GraphQL 11. Testing GraphQL Tools 12. Demo/QnA
  • 5. Introduction In the world of web development, there’s this powerful tool called GraphQL. It's like being your own chef in a restaurant kitchen, where you can order precisely what you want and how you want it. Let's take a peek at this cool way of getting data from the web, where you're in charge of your data order, getting only what you need, just how you want it, and all from one place!
  • 6. Let's Understand with an example:- User Id Name age gender Address Id Street City Country Job Id Organization Department Join_Date Salary Id Type Pay Tax HomeScreen Name Department City SalaryPay
  • 8. What is GraphQL ? • GraphQL is a query language and server-side runtime for fulfilling those queries on your existing data. • GraphQL isn't tied to any specific database or storage engine and is instead backed by your existing code and data. • GraphQL was developed by Facebook in 2012 . After that, it was publicly released in 2015 at the React.js conference. • It was developed to optimize RESTful API calls and provides a flexible, robust, and more efficient alternative to REST.
  • 9. Why use GraphQL ? • We already had an API named REST for data communication, which follows a clear and well-structured resource- oriented approach. • It also provides some great ideas such as stateless servers, structured access to resources, etc. • REST is not so flexible to cope up with the rapidly changing requirements of the clients that access them. • In this case, when the data gets more complex, the routes get longer. Sometimes, it is challenging to fetch the data with a single request. That's why we use GraphQL.
  • 11. Mutation Type Query type Query{ user(id: ID): User department(id: ID): Dept users: [User] dept: [Depatment] } type Mutation { AddUser(name: String) AddDepart(name: String) } type User{ id:String! name:String! age:Int Address:String } Components of GraphQL Resolvers User: { type: UserType, args: {id: {type: GraphQLID}}, resolve(parent, args){ return Movie.findById(args.id); } }
  • 12. Query in GraphQL • In simple terms, queries are ways to get data from the server. No more over or under fetching, you get what exactly you ask. It is a read-only fetch operation. • In the REST world, queries are equivalent to how you’d use Request with a payload to get a response from the server. Example:- • the schema allows the users to query for four different types of data: • A Book with a valid ID. • An Author with a valid ID. • To fetch all the Books, that returns a data type LIST. • To fetch all the Authors, that returns a data type LIST. type Query { book(id: int): Books author(id: int): Authors books:[Books] author: [Authors] }
  • 13. Mutation in GraphQL • The mutations are equivalent to how you’d use the CRUD operation along with Verbs such as GET, POST, PUT, PATCH and DELETE in the REST world. • In GraphQL, It will always be a POST call. It's a write followed by fetch operation. Example:- See the two mutations that are shown for Adding a Book that should return a new Book for us and Add Author that should return a new Author: type Mutation { addBook(name: String!, authorId: int): Books addAuthor(name: String!): Author }
  • 14. Why GraphQL API Is The Perfect Data Layer For Your Backend • One unified endpoint for your backend • Improved application performance • Improved system reliability • Better developer experience
  • 15. Why Test GraphQL? • Schema Changes: Ensure modifications to the API schema don't break existing functionality. • Functional Validation: Confirm that queries, mutations, and subscriptions return expected results and perform desired operations. • Performance Assurance: Assess API performance under complex queries and data loads. • Security Checks: Identify and fix vulnerabilities like injection attacks, unauthorized access, and data exposure. • Error Handling: Verify graceful error handling, ensuring informative responses for clients. Why
  • 16. Advantages of GraphQL • GraphQL is faster. • No over-fetching and under-fetching problems • Hierarchical Structure • Defines a data shape • Strongly typed
  • 17. 02 01 Best practices To Test GraphQL 03 • Empty arrays • Maximum/minimum values • Invalid query handling • Authentication failures • Authorization denials Edge Cases and Error 04 • Missing required fields • Incorrect argument types • Violating custom validations • Field-level validations • Input object validations Query and Mutation • Concurrent request handling • Response time evaluation • Batched query performance • Caching effectiveness Performance and Load • Authenticated and unauthenticated requests • Valid and invalid tokens • Different user roles and permissions • Accessing restricted resources Test Authentication
  • 21. Test GraphQL on Postman
  • 22. DEMO
  • 23. Q&A