SlideShare a Scribd company logo
1 of 24
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
Testing Graph QL Presentation (Test Automation)

More Related Content

Similar to Testing Graph QL Presentation (Test Automation)

apidays LIVE Australia - Have your cake and eat it too: GraphQL? REST? Why no...
apidays LIVE Australia - Have your cake and eat it too: GraphQL? REST? Why no...apidays LIVE Australia - Have your cake and eat it too: GraphQL? REST? Why no...
apidays LIVE Australia - Have your cake and eat it too: GraphQL? REST? Why no...apidays
 
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
 
GraphQL API Crafts presentation
GraphQL API Crafts presentationGraphQL API Crafts presentation
GraphQL API Crafts presentationSudheer J
 
GraphQL research summary
GraphQL research summaryGraphQL research summary
GraphQL research summaryObjectivity
 
Create GraphQL server with apolloJS
Create GraphQL server with apolloJSCreate GraphQL server with apolloJS
Create GraphQL server with apolloJSJonathan Jalouzot
 
Roundtable_-_API_Research__Testing_Tools.pdf
Roundtable_-_API_Research__Testing_Tools.pdfRoundtable_-_API_Research__Testing_Tools.pdf
Roundtable_-_API_Research__Testing_Tools.pdfMostafa Higazy
 
Introduction to GraphQL Presentation.pptx
Introduction to GraphQL Presentation.pptxIntroduction to GraphQL Presentation.pptx
Introduction to GraphQL Presentation.pptxKnoldus Inc.
 
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
 
Graphql for Frontend Developers Simplifying Data Fetching.docx
Graphql for Frontend Developers Simplifying Data Fetching.docxGraphql for Frontend Developers Simplifying Data Fetching.docx
Graphql for Frontend Developers Simplifying Data Fetching.docxssuser5583681
 
Real Time Serverless Polling App
Real Time Serverless Polling AppReal Time Serverless Polling App
Real Time Serverless Polling AppSrushith Repakula
 
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20Phil Wilkins
 
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
 
Sashko Stubailo - The GraphQL and Apollo Stack: connecting everything together
Sashko Stubailo - The GraphQL and Apollo Stack: connecting everything togetherSashko Stubailo - The GraphQL and Apollo Stack: connecting everything together
Sashko Stubailo - The GraphQL and Apollo Stack: connecting everything togetherReact Conf Brasil
 
The Apollo and GraphQL Stack
The Apollo and GraphQL StackThe Apollo and GraphQL Stack
The Apollo and GraphQL StackSashko Stubailo
 
Deploying GraphQL Services as Managed APIs
Deploying GraphQL Services as Managed APIsDeploying GraphQL Services as Managed APIs
Deploying GraphQL Services as Managed APIsWSO2
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQLRodrigo Prates
 
Camunda GraphQL Extension (09/2017 Berlin)
Camunda GraphQL Extension (09/2017 Berlin)Camunda GraphQL Extension (09/2017 Berlin)
Camunda GraphQL Extension (09/2017 Berlin)Harald J. Loydl
 

Similar to Testing Graph QL Presentation (Test Automation) (20)

apidays LIVE Australia - Have your cake and eat it too: GraphQL? REST? Why no...
apidays LIVE Australia - Have your cake and eat it too: GraphQL? REST? Why no...apidays LIVE Australia - Have your cake and eat it too: GraphQL? REST? Why no...
apidays LIVE Australia - Have your cake and eat it too: GraphQL? REST? Why no...
 
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 API Crafts presentation
GraphQL API Crafts presentationGraphQL API Crafts presentation
GraphQL API Crafts presentation
 
GraphQL research summary
GraphQL research summaryGraphQL research summary
GraphQL research summary
 
Create GraphQL server with apolloJS
Create GraphQL server with apolloJSCreate GraphQL server with apolloJS
Create GraphQL server with apolloJS
 
Graphql
GraphqlGraphql
Graphql
 
Roundtable_-_API_Research__Testing_Tools.pdf
Roundtable_-_API_Research__Testing_Tools.pdfRoundtable_-_API_Research__Testing_Tools.pdf
Roundtable_-_API_Research__Testing_Tools.pdf
 
Introduction to GraphQL Presentation.pptx
Introduction to GraphQL Presentation.pptxIntroduction to GraphQL Presentation.pptx
Introduction to GraphQL Presentation.pptx
 
Hands On - GraphQL
Hands On - GraphQLHands On - GraphQL
Hands On - GraphQL
 
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)
 
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
 
Real Time Serverless Polling App
Real Time Serverless Polling AppReal Time Serverless Polling App
Real Time Serverless Polling App
 
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
 
GraphQL.net
GraphQL.netGraphQL.net
GraphQL.net
 
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
 
Sashko Stubailo - The GraphQL and Apollo Stack: connecting everything together
Sashko Stubailo - The GraphQL and Apollo Stack: connecting everything togetherSashko Stubailo - The GraphQL and Apollo Stack: connecting everything together
Sashko Stubailo - The GraphQL and Apollo Stack: connecting everything together
 
The Apollo and GraphQL Stack
The Apollo and GraphQL StackThe Apollo and GraphQL Stack
The Apollo and GraphQL Stack
 
Deploying GraphQL Services as Managed APIs
Deploying GraphQL Services as Managed APIsDeploying GraphQL Services as Managed APIs
Deploying GraphQL Services as Managed APIs
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQL
 
Camunda GraphQL Extension (09/2017 Berlin)
Camunda GraphQL Extension (09/2017 Berlin)Camunda GraphQL Extension (09/2017 Berlin)
Camunda GraphQL Extension (09/2017 Berlin)
 

More from Knoldus 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.
 
The Power of Dependency Injection with Dagger 2 and Kotlin
The Power of Dependency Injection with Dagger 2 and KotlinThe Power of Dependency Injection with Dagger 2 and Kotlin
The Power of Dependency Injection with Dagger 2 and KotlinKnoldus Inc.
 
Data Engineering with Databricks Presentation
Data Engineering with Databricks PresentationData Engineering with Databricks Presentation
Data Engineering with Databricks PresentationKnoldus Inc.
 
Databricks for MLOps Presentation (AI/ML)
Databricks for MLOps Presentation (AI/ML)Databricks for MLOps Presentation (AI/ML)
Databricks for MLOps Presentation (AI/ML)Knoldus Inc.
 
NoOps - (Automate Ops) Presentation.pptx
NoOps - (Automate Ops) Presentation.pptxNoOps - (Automate Ops) Presentation.pptx
NoOps - (Automate Ops) Presentation.pptxKnoldus Inc.
 
Mastering Distributed Performance Testing
Mastering Distributed Performance TestingMastering Distributed Performance Testing
Mastering Distributed Performance TestingKnoldus Inc.
 
MLops on Vertex AI Presentation (AI/ML).pptx
MLops on Vertex AI Presentation (AI/ML).pptxMLops on Vertex AI Presentation (AI/ML).pptx
MLops on Vertex AI Presentation (AI/ML).pptxKnoldus Inc.
 
Introduction to Ansible Tower Presentation
Introduction to Ansible Tower PresentationIntroduction to Ansible Tower Presentation
Introduction to Ansible Tower PresentationKnoldus Inc.
 
CQRS with dot net services presentation.
CQRS with dot net services presentation.CQRS with dot net services presentation.
CQRS with dot net services presentation.Knoldus Inc.
 

More from Knoldus Inc. (20)

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
 
The Power of Dependency Injection with Dagger 2 and Kotlin
The Power of Dependency Injection with Dagger 2 and KotlinThe Power of Dependency Injection with Dagger 2 and Kotlin
The Power of Dependency Injection with Dagger 2 and Kotlin
 
Data Engineering with Databricks Presentation
Data Engineering with Databricks PresentationData Engineering with Databricks Presentation
Data Engineering with Databricks Presentation
 
Databricks for MLOps Presentation (AI/ML)
Databricks for MLOps Presentation (AI/ML)Databricks for MLOps Presentation (AI/ML)
Databricks for MLOps Presentation (AI/ML)
 
NoOps - (Automate Ops) Presentation.pptx
NoOps - (Automate Ops) Presentation.pptxNoOps - (Automate Ops) Presentation.pptx
NoOps - (Automate Ops) Presentation.pptx
 
Mastering Distributed Performance Testing
Mastering Distributed Performance TestingMastering Distributed Performance Testing
Mastering Distributed Performance Testing
 
MLops on Vertex AI Presentation (AI/ML).pptx
MLops on Vertex AI Presentation (AI/ML).pptxMLops on Vertex AI Presentation (AI/ML).pptx
MLops on Vertex AI Presentation (AI/ML).pptx
 
Introduction to Ansible Tower Presentation
Introduction to Ansible Tower PresentationIntroduction to Ansible Tower Presentation
Introduction to Ansible Tower Presentation
 
CQRS with dot net services presentation.
CQRS with dot net services presentation.CQRS with dot net services presentation.
CQRS with dot net services presentation.
 

Recently uploaded

SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 

Recently uploaded (20)

SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 

Testing Graph QL Presentation (Test Automation)

  • 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