SlideShare a Scribd company logo
1 of 17
GraphQL
Vipin Kumar
Agenda [ What ]
1. REST Refresher
2. Introduction of GraphQL
3. Queries
4. SDL, Schema Design (Graph Thinking)
5. Query Resolvers
6. In Action with Spring Boot
7. Performance
8. Resources
REST Refresher [ API First ]
1. http://<host>:<port>/<context>/blogs GET
2. http://<host>:<port>/<context>/blogs POST
3. http://<host>:<port>/<context>/blogs /{id} DELETE
4. http://<host>:<port>/<context>/blogs PUT
5. http://<host>:<port>/<context>/blogs/{id} GET
We generally design rest endpoints be letting the action defined by the
http methods. These are very simple use cases.
Introduction of GraphQL [ But Why ? ]
We have seen a very simple use case of blog service REST APIs in the previous slide. Which
does not require very complex API call sequencing, but REST style suffers majorly from the
issue like
1. Overfetching and Underfetching
2. Network Requests
3. Caching
4. Error Handling
5. Versioning
6. Require discipline on both sides
Again Introduction of GraphQL [ Client First ]
GraphQL is the specifications developed by Facebook and later open sourced. Now maintained by the
community. It’s again a change in mindset from REST in a similar way the shift happen from SOAP to
REST
From Official Site
“GraphQL is a query language for your API, and a server-side runtime for executing queries by using
a type system you define for your data. GraphQL isn't tied to any specific database or storage
engine and is instead backed by your existing code and data”
Where GraphQL stands ?
Queries [ How ]
GraphQL queries are divided in three types
1. Query : For querying the data from APIs
2. Mutation : To update or make any changes in stored data
3. Subscription : To get notifications if any state changes in data
How the hell query look like ?
Query Mutation
SDL
[Schema
Definition
Language]
File with the extension
.graphqls
SDL continues ...
1. Objects as type
2. Enum
3. Interface
So whatever can be thought as an object can be
represented in GraphQL schema.
GraphQL allows you to think in terms of a graph
and its node as entities involved and then design
the communication. But the result of GraphQL
queries is always a tree.
Query Resolvers
These actually map the schema to the actual
execution points. GraphQl provides query
resolvers based on the type of queries mentioned
in schemas. But it has three main resolvers
1. Query Resolver
2. Mutation Query Resolver
3. Subscription Query Resolver
Enough With The Talk, Show me the example !
[ In Action with Spring Boot ]
Covering this GraphQL in action example using spring boot
and libraries of GraphQL in java. A blog service is created
with architecture mentioned in the diagram
https://github.com/vipin-pratap18/java-graphql-springboot
Performance and other issues
GraphQL solves RESTs problem but introduces its own like a contract between a client and server has to be
established beforehand. This is GraphQLs biggest feature and challenge sometimes as developer and designers
have to think and document all the possible use cases required to cover in output.
Performance is slow than REST as GraphQL has to identify the relationship and fetch all the dependent objects
separately if required in response.
It does not have any good documentation and monitoring tools available as of now.
Queries will be very rigid, though it is called query language query structure and parameters are fixed like REST.
GraphQL exposes the risk of the arbitrary request as in REST endpoint structure and parameters are fixed so without
match it will not proceed. This might not be the case with GraphQL sometimes. Which might leads to DDoS.
No proper response codes against any request, server, validation failure at server end.
So where it is useful !
GraphQL is proving its worth on both Web and
Mobile apps. But real difference can be seen on
the mobile app, as these devices are low on
memory and cannot load a large amount of data.
Which can be controlled by the client itself in
GraphQL.
In a web application it has the capability to
segregate the multiple API calls in one and also
can control the data going out of the service.
Trends !!!
Resources
1. https://graphql.org
2. http://graphdatamodeling.com/Graph%20Data%20Modeling/GraphQL/GraphQL.html
3. https://philsturgeon.uk/api/2017/01/24/graphql-vs-rest-overview/
4. https://github.com/vipin-pratap18/java-graphql-springboot
Thanks For Your Time

More Related Content

What's hot

REST vs GraphQL
REST vs GraphQLREST vs GraphQL
REST vs GraphQLSquareboat
 
Graphql Intro (Tutorial and Example)
Graphql Intro (Tutorial and Example)Graphql Intro (Tutorial and Example)
Graphql Intro (Tutorial and Example)Rafael Wilber Kerr
 
GraphQL: Enabling a new generation of API developer tools
GraphQL: Enabling a new generation of API developer toolsGraphQL: Enabling a new generation of API developer tools
GraphQL: Enabling a new generation of API developer toolsSashko Stubailo
 
Spring boot Introduction
Spring boot IntroductionSpring boot Introduction
Spring boot IntroductionJeevesh Pandey
 
GraphQL vs REST
GraphQL vs RESTGraphQL vs REST
GraphQL vs RESTGreeceJS
 
An intro to GraphQL
An intro to GraphQLAn intro to GraphQL
An intro to GraphQLvaluebound
 
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...luisw19
 
Introduction to GraphQL: Mobile Week SF
Introduction to GraphQL: Mobile Week SFIntroduction to GraphQL: Mobile Week SF
Introduction to GraphQL: Mobile Week SFAmazon Web Services
 
Better APIs with GraphQL
Better APIs with GraphQL Better APIs with GraphQL
Better APIs with GraphQL Josh Price
 
How to GraphQL
How to GraphQLHow to GraphQL
How to GraphQLTomasz Bak
 
Microservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring CloudMicroservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring CloudEberhard Wolff
 
Introduction to Spring Boot
Introduction to Spring BootIntroduction to Spring Boot
Introduction to Spring BootTrey Howard
 

What's hot (20)

REST vs GraphQL
REST vs GraphQLREST vs GraphQL
REST vs GraphQL
 
Graphql Intro (Tutorial and Example)
Graphql Intro (Tutorial and Example)Graphql Intro (Tutorial and Example)
Graphql Intro (Tutorial and Example)
 
GraphQL: Enabling a new generation of API developer tools
GraphQL: Enabling a new generation of API developer toolsGraphQL: Enabling a new generation of API developer tools
GraphQL: Enabling a new generation of API developer tools
 
Spring boot Introduction
Spring boot IntroductionSpring boot Introduction
Spring boot Introduction
 
GraphQL Fundamentals
GraphQL FundamentalsGraphQL Fundamentals
GraphQL Fundamentals
 
GraphQL vs REST
GraphQL vs RESTGraphQL vs REST
GraphQL vs REST
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQL
 
Introduction to Spring Boot
Introduction to Spring BootIntroduction to Spring Boot
Introduction to Spring Boot
 
An intro to GraphQL
An intro to GraphQLAn intro to GraphQL
An intro to GraphQL
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQL
 
GraphQL
GraphQLGraphQL
GraphQL
 
Spring MVC Framework
Spring MVC FrameworkSpring MVC Framework
Spring MVC Framework
 
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
 
Introduction to GraphQL: Mobile Week SF
Introduction to GraphQL: Mobile Week SFIntroduction to GraphQL: Mobile Week SF
Introduction to GraphQL: Mobile Week SF
 
Better APIs with GraphQL
Better APIs with GraphQL Better APIs with GraphQL
Better APIs with GraphQL
 
How to GraphQL
How to GraphQLHow to GraphQL
How to GraphQL
 
Microservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring CloudMicroservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring Cloud
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
 
Angular Observables & RxJS Introduction
Angular Observables & RxJS IntroductionAngular Observables & RxJS Introduction
Angular Observables & RxJS Introduction
 
Introduction to Spring Boot
Introduction to Spring BootIntroduction to Spring Boot
Introduction to Spring Boot
 

Similar to GraphQL Introduction with Spring Boot

GraphQL over REST at Reactathon 2018
GraphQL over REST at Reactathon 2018GraphQL over REST at Reactathon 2018
GraphQL over REST at Reactathon 2018Sashko Stubailo
 
GraphQL across the stack: How everything fits together
GraphQL across the stack: How everything fits togetherGraphQL across the stack: How everything fits together
GraphQL across the stack: How everything fits togetherSashko Stubailo
 
How easy (or hard) it is to monitor your graph ql service performance
How easy (or hard) it is to monitor your graph ql service performanceHow easy (or hard) it is to monitor your graph ql service performance
How easy (or hard) it is to monitor your graph ql service performanceLuca Mattia Ferrari
 
React, GraphQL и Relay - вполне себе нормальный компонентный подход (nodkz)
React, GraphQL и Relay - вполне себе нормальный компонентный подход (nodkz)React, GraphQL и Relay - вполне себе нормальный компонентный подход (nodkz)
React, GraphQL и Relay - вполне себе нормальный компонентный подход (nodkz)Pavel Chertorogov
 
GraphQL research summary
GraphQL research summaryGraphQL research summary
GraphQL research summaryObjectivity
 
GraphQL-ify your APIs - Devoxx UK 2021
 GraphQL-ify your APIs - Devoxx UK 2021 GraphQL-ify your APIs - Devoxx UK 2021
GraphQL-ify your APIs - Devoxx UK 2021Soham Dasgupta
 
Online grocery store
Online grocery storeOnline grocery store
Online grocery storeKavita Sharma
 
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
 
servlet 2.5 & JSP 2.0
servlet 2.5 & JSP 2.0servlet 2.5 & JSP 2.0
servlet 2.5 & JSP 2.0megrhi haikel
 
GraphQL API Gateway and microservices
GraphQL API Gateway and microservicesGraphQL API Gateway and microservices
GraphQL API Gateway and microservicesMohammed Shaban
 
What could go wrong with a GraphQL query and can OpenTelemetry help? KubeCon...
What could go wrong  with a GraphQL query and can OpenTelemetry help? KubeCon...What could go wrong  with a GraphQL query and can OpenTelemetry help? KubeCon...
What could go wrong with a GraphQL query and can OpenTelemetry help? KubeCon...SonjaChevre
 
Jsp and Servlets
Jsp and ServletsJsp and Servlets
Jsp and ServletsRaghu nath
 
Struts 2 Overview
Struts 2 OverviewStruts 2 Overview
Struts 2 Overviewskill-guru
 
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
 
Stéphane Nicoll and Madhura Bhave at SpringOne Platform 2017
Stéphane Nicoll and Madhura Bhave at SpringOne Platform 2017Stéphane Nicoll and Madhura Bhave at SpringOne Platform 2017
Stéphane Nicoll and Madhura Bhave at SpringOne Platform 2017VMware Tanzu
 
Introduction to Testing GraphQL Presentation
Introduction to Testing GraphQL PresentationIntroduction to Testing GraphQL Presentation
Introduction to Testing GraphQL PresentationKnoldus Inc.
 
Testing Graph QL Presentation (Test Automation)
Testing Graph QL Presentation (Test Automation)Testing Graph QL Presentation (Test Automation)
Testing Graph QL Presentation (Test Automation)Knoldus Inc.
 

Similar to GraphQL Introduction with Spring Boot (20)

GraphQL over REST at Reactathon 2018
GraphQL over REST at Reactathon 2018GraphQL over REST at Reactathon 2018
GraphQL over REST at Reactathon 2018
 
GraphQL across the stack: How everything fits together
GraphQL across the stack: How everything fits togetherGraphQL across the stack: How everything fits together
GraphQL across the stack: How everything fits together
 
Graphql
GraphqlGraphql
Graphql
 
How easy (or hard) it is to monitor your graph ql service performance
How easy (or hard) it is to monitor your graph ql service performanceHow easy (or hard) it is to monitor your graph ql service performance
How easy (or hard) it is to monitor your graph ql service performance
 
React, GraphQL и Relay - вполне себе нормальный компонентный подход (nodkz)
React, GraphQL и Relay - вполне себе нормальный компонентный подход (nodkz)React, GraphQL и Relay - вполне себе нормальный компонентный подход (nodkz)
React, GraphQL и Relay - вполне себе нормальный компонентный подход (nodkz)
 
GraphQL research summary
GraphQL research summaryGraphQL research summary
GraphQL research summary
 
GraphQL-ify your APIs - Devoxx UK 2021
 GraphQL-ify your APIs - Devoxx UK 2021 GraphQL-ify your APIs - Devoxx UK 2021
GraphQL-ify your APIs - Devoxx UK 2021
 
Online grocery store
Online grocery storeOnline grocery store
Online grocery store
 
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)
 
servlet 2.5 & JSP 2.0
servlet 2.5 & JSP 2.0servlet 2.5 & JSP 2.0
servlet 2.5 & JSP 2.0
 
codersera_com (1).pdf
codersera_com (1).pdfcodersera_com (1).pdf
codersera_com (1).pdf
 
GraphQL API Gateway and microservices
GraphQL API Gateway and microservicesGraphQL API Gateway and microservices
GraphQL API Gateway and microservices
 
What could go wrong with a GraphQL query and can OpenTelemetry help? KubeCon...
What could go wrong  with a GraphQL query and can OpenTelemetry help? KubeCon...What could go wrong  with a GraphQL query and can OpenTelemetry help? KubeCon...
What could go wrong with a GraphQL query and can OpenTelemetry help? KubeCon...
 
Jsp and Servlets
Jsp and ServletsJsp and Servlets
Jsp and Servlets
 
Struts 2 Overview
Struts 2 OverviewStruts 2 Overview
Struts 2 Overview
 
Camunda GraphQL Extension (09/2017 Berlin)
Camunda GraphQL Extension (09/2017 Berlin)Camunda GraphQL Extension (09/2017 Berlin)
Camunda GraphQL Extension (09/2017 Berlin)
 
Stéphane Nicoll and Madhura Bhave at SpringOne Platform 2017
Stéphane Nicoll and Madhura Bhave at SpringOne Platform 2017Stéphane Nicoll and Madhura Bhave at SpringOne Platform 2017
Stéphane Nicoll and Madhura Bhave at SpringOne Platform 2017
 
GraphQL.net
GraphQL.netGraphQL.net
GraphQL.net
 
Introduction to Testing GraphQL Presentation
Introduction to Testing GraphQL PresentationIntroduction to Testing GraphQL Presentation
Introduction to Testing GraphQL Presentation
 
Testing Graph QL Presentation (Test Automation)
Testing Graph QL Presentation (Test Automation)Testing Graph QL Presentation (Test Automation)
Testing Graph QL Presentation (Test Automation)
 

Recently uploaded

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
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
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
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
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
"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
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
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
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 

Recently uploaded (20)

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
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
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
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
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
"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...
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 

GraphQL Introduction with Spring Boot

  • 2. Agenda [ What ] 1. REST Refresher 2. Introduction of GraphQL 3. Queries 4. SDL, Schema Design (Graph Thinking) 5. Query Resolvers 6. In Action with Spring Boot 7. Performance 8. Resources
  • 3. REST Refresher [ API First ] 1. http://<host>:<port>/<context>/blogs GET 2. http://<host>:<port>/<context>/blogs POST 3. http://<host>:<port>/<context>/blogs /{id} DELETE 4. http://<host>:<port>/<context>/blogs PUT 5. http://<host>:<port>/<context>/blogs/{id} GET We generally design rest endpoints be letting the action defined by the http methods. These are very simple use cases.
  • 4. Introduction of GraphQL [ But Why ? ] We have seen a very simple use case of blog service REST APIs in the previous slide. Which does not require very complex API call sequencing, but REST style suffers majorly from the issue like 1. Overfetching and Underfetching 2. Network Requests 3. Caching 4. Error Handling 5. Versioning 6. Require discipline on both sides
  • 5. Again Introduction of GraphQL [ Client First ] GraphQL is the specifications developed by Facebook and later open sourced. Now maintained by the community. It’s again a change in mindset from REST in a similar way the shift happen from SOAP to REST From Official Site “GraphQL is a query language for your API, and a server-side runtime for executing queries by using a type system you define for your data. GraphQL isn't tied to any specific database or storage engine and is instead backed by your existing code and data”
  • 7. Queries [ How ] GraphQL queries are divided in three types 1. Query : For querying the data from APIs 2. Mutation : To update or make any changes in stored data 3. Subscription : To get notifications if any state changes in data
  • 8. How the hell query look like ? Query Mutation
  • 10. SDL continues ... 1. Objects as type 2. Enum 3. Interface So whatever can be thought as an object can be represented in GraphQL schema. GraphQL allows you to think in terms of a graph and its node as entities involved and then design the communication. But the result of GraphQL queries is always a tree.
  • 11. Query Resolvers These actually map the schema to the actual execution points. GraphQl provides query resolvers based on the type of queries mentioned in schemas. But it has three main resolvers 1. Query Resolver 2. Mutation Query Resolver 3. Subscription Query Resolver
  • 12. Enough With The Talk, Show me the example ! [ In Action with Spring Boot ] Covering this GraphQL in action example using spring boot and libraries of GraphQL in java. A blog service is created with architecture mentioned in the diagram https://github.com/vipin-pratap18/java-graphql-springboot
  • 13. Performance and other issues GraphQL solves RESTs problem but introduces its own like a contract between a client and server has to be established beforehand. This is GraphQLs biggest feature and challenge sometimes as developer and designers have to think and document all the possible use cases required to cover in output. Performance is slow than REST as GraphQL has to identify the relationship and fetch all the dependent objects separately if required in response. It does not have any good documentation and monitoring tools available as of now. Queries will be very rigid, though it is called query language query structure and parameters are fixed like REST. GraphQL exposes the risk of the arbitrary request as in REST endpoint structure and parameters are fixed so without match it will not proceed. This might not be the case with GraphQL sometimes. Which might leads to DDoS. No proper response codes against any request, server, validation failure at server end.
  • 14. So where it is useful ! GraphQL is proving its worth on both Web and Mobile apps. But real difference can be seen on the mobile app, as these devices are low on memory and cannot load a large amount of data. Which can be controlled by the client itself in GraphQL. In a web application it has the capability to segregate the multiple API calls in one and also can control the data going out of the service.
  • 16. Resources 1. https://graphql.org 2. http://graphdatamodeling.com/Graph%20Data%20Modeling/GraphQL/GraphQL.html 3. https://philsturgeon.uk/api/2017/01/24/graphql-vs-rest-overview/ 4. https://github.com/vipin-pratap18/java-graphql-springboot