SlideShare a Scribd company logo
GraphQL-ify your APIs
Soham Dasgupta
Soham Dasgupta
• Father, Husband and Football lover
• Capgemini Netherlands
• Oracle ACE
• Tech Enthusiast/Programmer/Architect
• Speaker & Blogger
• Twitter : @iamsoham
• LinkedIn: dasguptasoham
• Github: sohamda
• Medium: @iam.soham
Who am I?
What’s in store today
GraphQL
What
Queries & Mutation
Schemas & Types
Show me some code
graphql-java
graphql-java-kickstart
graphql-dgs-framework
What’s better
Implementation easiness – code,
generation, error handling, testing,
clients
N+1 problem
Memory footprint
GraphQL is a query language for your API, and a
server-side runtime for executing queries.
Backed by your existing code and data.
It was designed by Facebook to get around
common constraints in fetching data via REST.
It was open sourced by Facebook in 2015.
Nothing to do with Graph DB.
Not a replacement of REST.
Not going to magically solve every API design
issues.
What’s GraphQL
Schema Query Results
Schema , Query & Results
GraphQL provides description of the data in your API, gives clients the power to ask for exactly
what they need.
https://landscape.graphql.org/card-mode?category=graph-ql-adopter&grouping=category&style=borderless
Who is using it ?
GraphQL vs REST API vs SOAP
https://trends.google.com/trends/explore?date=today%205-y&q=%2Fg%2F11cn3w0w9t,REST%20API,%2Fm%2F077dn
Hierarchical & Aggregator Strongly Typed
Validation & Type check
out-of-the-box
API evolution without
versioning
GraphQL
Characteristics
Query & Mutation
• Ask what you need.
• Expand the same
query.
• Send arguments.
• Use Aliases, Fragment
Schemas & Types
• GraphQL schema language -
allows us to talk about
GraphQL schemas in a
language-agnostic way.
• Scalar : Int, String, Boolean, ID,
Float
• Lists & Non-Null
• Union, Interfaces, Input Types
N+1 queries Caching complexity
Community presence File Upload
GraphQL
Maturity
Show me some code
graphql-java
graphql-java-kickstart
graphql-dgs-framework
https://github.com/sohamda/serivce-repository-swagger
graphql-java https://www.graphql-java.com/documentation/v17/
https://github.com/graphql-java - Version 17.3 : Last updated on Sep’21
https://github.com/graphql-java/graphql-java-spring
https://github.com/sohamda/graphql-java
graphql-java- kickstart https://graphql-java-kickstart.com/
https://github.com/graphql-java-kickstart
Version 12 : Last updated on Sep’21
https://github.com/sohamda/graphql-java-kickstart
dgs-framework
https://netflix.github.io/dgs/
https://github.com/Netflix/dgs-framework
Version 4.9.2 : Last updated on Oct’21
https://github.com/sohamda/graphql-dgs-netflix
What’s better
Implementation easiness – code, generation, error
handling, testing, clients
N+1 problem
Memory footprint
DataFetchers
graphql-java
Piece of code that fetches the data
graphql-java-kickstart dgs
1. Define a @Component which
defines datafetching methods.
2. Register them in while
building/parsing the schema
1. Define @Component which
implements
GraphQLQueryResolver.
2. For field-level define a
@Component which
implements
GraphQLResolver<T>.
1. Define a @DgsComponent.
2. Map the schema operations
with @DgsData
DataLoaders
graphql-java
Piece of code that is responsible for N+1 query issue
graphql-java-kickstart dgs
1. Define a BatchLoader which
return s a CompletableFuture.
2. Define a DataLoaderRegistry
@Bean which registers the
Loader.
3. Define a DataFetcher using
that Loader.
1. Define @Component which
defines a loader and adds it to
the registry.
2. Define a @Component which
implements
GraphQLServletContextBuild
er and associate the registry.
1. Define a @DgsDataLoader.
2. Map the schema operations
with @DgsData
Mutations
graphql-java
Piece of code that persist the data
graphql-java-kickstart dgs
1. Define a @Component which
defines datafetching methods.
2. Register them in while
building/parsing the schema
• Define @Component which
implements
GraphQLMutationResolver.
1. Define a @DgsComponent.
2. Map the schema operations
with @DgsData
Error Handling
graphql-java
Piece of code that handles exceptions/errors
graphql-java-kickstart dgs
Implement GraphQLError 1. Enable ExceptionHandler
property and handle
them in a Spring way.
2. Implement
GraphQLErrorHandler
and manage the errors in
overridden method.
Define a @Component which
implements
DataFetcherExceptionHandle
r
Client
graphql-java
How to call a GraphQL API
graphql-java-kickstart dgs
1. No defined way.
2. Needs text templates to
generate requests.
1. Gives a Webclient library.
2. Needs text templates to
generate requests.
1. GraphQLClient uses String as
query which is same as the
previous two.
2. Code generation using
Gradle/Maven. This is the type-
safe option.
Testing
graphql-java
How to test your code
graphql-java-kickstart dgs
1. No defined way.
2. Only can test the service-repo
layer.
1. No defined way.
2. Only can test the service-repo
layer.
1. Code generation using Gradle.
This is the type-safe option.
2. Use the generated classes to
build request and test using
DgsAutoConfiguration class.
graphql-java graphql-java-kickstart dgs
1. No defined way. 1. No defined way. 1. Code generation using
Gradle/Maven.
Code Generation
Runtime memory & Image Size
Final Words
graphql-java graphql-java-kickstart dgs-framework
• Is there since long, so evolved
and matured.
• A lot of Boilerplate code just
to write a simple API.
• Need extra library to work in
Springboot. With other Java
• Not a easy way to Unit Test
everything you write.
• No Clients avaiable. Need to
use text templates to create
queries.
• Looks very matured but
missing extended
documentation.
• Still a bit of Boilerplate code.
• Directly usable within
Springboot. Although other
modules available to work on
Java only environments.
• Not a easy way to UT
everything you write.
• Basic Client avaiable.
• Not sure about maturity, but
Netflix is behind this, so faith
is there.
• No Boilerplate code.
• Directly usable within
Springboot.
• You can UT everything you
write.
• Client avaiable.
• Code generation using
Gradle/Maven.
https://medium.com/springboot-chronicles/graphql-in-springboot-a-comparative-study-
among-the-libraries-and-their-implementation-know-how-b0e8d544f2fc
This presentation contains information that may be privileged or confidential and
is the property of the Capgemini Group.
Copyright © 2021 Capgemini. All rights reserved.
Capgemini is a global leader in partnering with companies to transform and manage their
business by harnessing the power of technology. The Group is guided everyday by its
purpose of unleashing human energy through technology for an inclusive and sustainable
future. It is a responsible and diverse organization of 270,000 team members in nearly 50
countries. With its strong 50 year heritage and deep industry expertise, Capgemini is
trusted by its clients to address the entire breadth of their business needs, from strategy
and design to operations, fuelled by the fast evolving and innovative world of cloud, data,
AI, connectivity, software, digital engineering and platforms. The Group reported in 2020
global revenues of €16 billion.
About Capgemini
Get the Future You Want | www.capgemini.com

More Related Content

What's hot

Azure DevOps for the Data Professional
Azure DevOps for the Data ProfessionalAzure DevOps for the Data Professional
Azure DevOps for the Data ProfessionalSarah Dutkiewicz
 
Building the Web with Gradle
Building the Web with GradleBuilding the Web with Gradle
Building the Web with GradleEric Wendelin
 
Making Angular2 lean and Fast
Making Angular2 lean and FastMaking Angular2 lean and Fast
Making Angular2 lean and FastVinci Rufus
 
London React August - GraphQL at The Financial Times - Viktor Charypar
London React August - GraphQL at The Financial Times - Viktor CharyparLondon React August - GraphQL at The Financial Times - Viktor Charypar
London React August - GraphQL at The Financial Times - Viktor CharyparReact London Community
 
Boost your APIs with GraphQL 1.0
Boost your APIs with GraphQL 1.0Boost your APIs with GraphQL 1.0
Boost your APIs with GraphQL 1.0Otávio Santana
 
Kafka and GraphQL: Misconceptions and Connections | Gerard Klijs, Open Web
Kafka and GraphQL: Misconceptions and Connections | Gerard Klijs, Open WebKafka and GraphQL: Misconceptions and Connections | Gerard Klijs, Open Web
Kafka and GraphQL: Misconceptions and Connections | Gerard Klijs, Open WebHostedbyConfluent
 
Gradle(the innovation continues)
Gradle(the innovation continues)Gradle(the innovation continues)
Gradle(the innovation continues)Sejong Park
 
Angular vs React - Devoxx BE 2017
Angular vs React - Devoxx BE 2017Angular vs React - Devoxx BE 2017
Angular vs React - Devoxx BE 2017Deepu K Sasidharan
 
What's new in Gradle 4.0
What's new in Gradle 4.0What's new in Gradle 4.0
What's new in Gradle 4.0Eric Wendelin
 
Enterprise graph applications
Enterprise graph applicationsEnterprise graph applications
Enterprise graph applicationsDavid Colebatch
 
The Apollo and GraphQL Stack
The Apollo and GraphQL StackThe Apollo and GraphQL Stack
The Apollo and GraphQL StackSashko Stubailo
 
Continuous integration and delivery for java based web applications
Continuous integration and delivery for java based web applicationsContinuous integration and delivery for java based web applications
Continuous integration and delivery for java based web applicationsSunil Dalal
 
The Graph-Native Advantage
The Graph-Native AdvantageThe Graph-Native Advantage
The Graph-Native AdvantageNeo4j
 
Enterprise Architectures with Ruby (and Rails)
Enterprise Architectures with Ruby (and Rails)Enterprise Architectures with Ruby (and Rails)
Enterprise Architectures with Ruby (and Rails)Konstantin Gredeskoul
 

What's hot (20)

Azure DevOps for the Data Professional
Azure DevOps for the Data ProfessionalAzure DevOps for the Data Professional
Azure DevOps for the Data Professional
 
Building the Web with Gradle
Building the Web with GradleBuilding the Web with Gradle
Building the Web with Gradle
 
Making Angular2 lean and Fast
Making Angular2 lean and FastMaking Angular2 lean and Fast
Making Angular2 lean and Fast
 
London React August - GraphQL at The Financial Times - Viktor Charypar
London React August - GraphQL at The Financial Times - Viktor CharyparLondon React August - GraphQL at The Financial Times - Viktor Charypar
London React August - GraphQL at The Financial Times - Viktor Charypar
 
Boost your APIs with GraphQL 1.0
Boost your APIs with GraphQL 1.0Boost your APIs with GraphQL 1.0
Boost your APIs with GraphQL 1.0
 
Boost your API with GraphQL
Boost your API with GraphQLBoost your API with GraphQL
Boost your API with GraphQL
 
Kafka and GraphQL: Misconceptions and Connections | Gerard Klijs, Open Web
Kafka and GraphQL: Misconceptions and Connections | Gerard Klijs, Open WebKafka and GraphQL: Misconceptions and Connections | Gerard Klijs, Open Web
Kafka and GraphQL: Misconceptions and Connections | Gerard Klijs, Open Web
 
Neo4J and Grails
Neo4J and GrailsNeo4J and Grails
Neo4J and Grails
 
Introduction to Grails
Introduction to GrailsIntroduction to Grails
Introduction to Grails
 
Gradle build capabilities
Gradle build capabilities Gradle build capabilities
Gradle build capabilities
 
Gradle(the innovation continues)
Gradle(the innovation continues)Gradle(the innovation continues)
Gradle(the innovation continues)
 
Angular vs React - Devoxx BE 2017
Angular vs React - Devoxx BE 2017Angular vs React - Devoxx BE 2017
Angular vs React - Devoxx BE 2017
 
What's new in Gradle 4.0
What's new in Gradle 4.0What's new in Gradle 4.0
What's new in Gradle 4.0
 
Gradle
GradleGradle
Gradle
 
Enterprise graph applications
Enterprise graph applicationsEnterprise graph applications
Enterprise graph applications
 
The Apollo and GraphQL Stack
The Apollo and GraphQL StackThe Apollo and GraphQL Stack
The Apollo and GraphQL Stack
 
Continuous integration and delivery for java based web applications
Continuous integration and delivery for java based web applicationsContinuous integration and delivery for java based web applications
Continuous integration and delivery for java based web applications
 
Gradle by Example
Gradle by ExampleGradle by Example
Gradle by Example
 
The Graph-Native Advantage
The Graph-Native AdvantageThe Graph-Native Advantage
The Graph-Native Advantage
 
Enterprise Architectures with Ruby (and Rails)
Enterprise Architectures with Ruby (and Rails)Enterprise Architectures with Ruby (and Rails)
Enterprise Architectures with Ruby (and Rails)
 

Similar to GraphQL-ify your APIs - Devoxx UK 2021

GraphQL_devoxx_2023.pptx
GraphQL_devoxx_2023.pptxGraphQL_devoxx_2023.pptx
GraphQL_devoxx_2023.pptxSoham Dasgupta
 
GraphQL-ify your API - JFall 2022
GraphQL-ify your API - JFall 2022GraphQL-ify your API - JFall 2022
GraphQL-ify your API - JFall 2022Soham Dasgupta
 
Graphql presentation
Graphql presentationGraphql presentation
Graphql presentationVibhor Grover
 
Adding GraphQL to your existing architecture
Adding GraphQL to your existing architectureAdding GraphQL to your existing architecture
Adding GraphQL to your existing architectureSashko Stubailo
 
apidays LIVE Paris - GraphQL meshes by Jens Neuse
apidays LIVE Paris - GraphQL meshes by Jens Neuseapidays LIVE Paris - GraphQL meshes by Jens Neuse
apidays LIVE Paris - GraphQL meshes by Jens Neuseapidays
 
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
 
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
 
GraphQL over REST at Reactathon 2018
GraphQL over REST at Reactathon 2018GraphQL over REST at Reactathon 2018
GraphQL over REST at Reactathon 2018Sashko Stubailo
 
Implementing OpenAPI and GraphQL services with gRPC
Implementing OpenAPI and GraphQL services with gRPCImplementing OpenAPI and GraphQL services with gRPC
Implementing OpenAPI and GraphQL services with gRPCTim Burks
 
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
 
apidays LIVE Australia 2020 - Have your cake and eat it too: GraphQL? REST? W...
apidays LIVE Australia 2020 - Have your cake and eat it too: GraphQL? REST? W...apidays LIVE Australia 2020 - Have your cake and eat it too: GraphQL? REST? W...
apidays LIVE Australia 2020 - Have your cake and eat it too: GraphQL? REST? W...apidays
 
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.
 
Create GraphQL server with apolloJS
Create GraphQL server with apolloJSCreate GraphQL server with apolloJS
Create GraphQL server with apolloJSJonathan Jalouzot
 
React and GraphQL at Stripe
React and GraphQL at StripeReact and GraphQL at Stripe
React and GraphQL at StripeSashko Stubailo
 
Introduction to GraphQL (or How I Learned to Stop Worrying about REST APIs)
Introduction to GraphQL (or How I Learned to Stop Worrying about REST APIs)Introduction to GraphQL (or How I Learned to Stop Worrying about REST APIs)
Introduction to GraphQL (or How I Learned to Stop Worrying about REST APIs)Hafiz Ismail
 

Similar to GraphQL-ify your APIs - Devoxx UK 2021 (20)

GraphQL_devoxx_2023.pptx
GraphQL_devoxx_2023.pptxGraphQL_devoxx_2023.pptx
GraphQL_devoxx_2023.pptx
 
GraphQL-ify your API - JFall 2022
GraphQL-ify your API - JFall 2022GraphQL-ify your API - JFall 2022
GraphQL-ify your API - JFall 2022
 
GraphQL-ify your APIs
GraphQL-ify your APIsGraphQL-ify your APIs
GraphQL-ify your APIs
 
GraphQL.net
GraphQL.netGraphQL.net
GraphQL.net
 
Spring GraphQL
Spring GraphQLSpring GraphQL
Spring GraphQL
 
Graphql presentation
Graphql presentationGraphql presentation
Graphql presentation
 
Adding GraphQL to your existing architecture
Adding GraphQL to your existing architectureAdding GraphQL to your existing architecture
Adding GraphQL to your existing architecture
 
apidays LIVE Paris - GraphQL meshes by Jens Neuse
apidays LIVE Paris - GraphQL meshes by Jens Neuseapidays LIVE Paris - GraphQL meshes by Jens Neuse
apidays LIVE Paris - GraphQL meshes by Jens Neuse
 
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
 
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 over REST at Reactathon 2018
GraphQL over REST at Reactathon 2018GraphQL over REST at Reactathon 2018
GraphQL over REST at Reactathon 2018
 
Implementing OpenAPI and GraphQL services with gRPC
Implementing OpenAPI and GraphQL services with gRPCImplementing OpenAPI and GraphQL services with gRPC
Implementing OpenAPI and GraphQL services with gRPC
 
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
 
Boost your APIs with GraphQL
Boost your APIs with GraphQLBoost your APIs with GraphQL
Boost your APIs with GraphQL
 
apidays LIVE Australia 2020 - Have your cake and eat it too: GraphQL? REST? W...
apidays LIVE Australia 2020 - Have your cake and eat it too: GraphQL? REST? W...apidays LIVE Australia 2020 - Have your cake and eat it too: GraphQL? REST? W...
apidays LIVE Australia 2020 - Have your cake and eat it too: GraphQL? REST? W...
 
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)
 
Create GraphQL server with apolloJS
Create GraphQL server with apolloJSCreate GraphQL server with apolloJS
Create GraphQL server with apolloJS
 
React and GraphQL at Stripe
React and GraphQL at StripeReact and GraphQL at Stripe
React and GraphQL at Stripe
 
Introduction to GraphQL (or How I Learned to Stop Worrying about REST APIs)
Introduction to GraphQL (or How I Learned to Stop Worrying about REST APIs)Introduction to GraphQL (or How I Learned to Stop Worrying about REST APIs)
Introduction to GraphQL (or How I Learned to Stop Worrying about REST APIs)
 

More from Soham Dasgupta

Are you testing your unit tests?
Are you testing your unit tests?Are you testing your unit tests?
Are you testing your unit tests?Soham Dasgupta
 
Spring Native : Why not YET!
Spring Native : Why not YET!Spring Native : Why not YET!
Spring Native : Why not YET!Soham Dasgupta
 
OneBot: A Comprehensive Case Study on Enterprise Digital Assistants
OneBot: A Comprehensive Case Study on Enterprise Digital AssistantsOneBot: A Comprehensive Case Study on Enterprise Digital Assistants
OneBot: A Comprehensive Case Study on Enterprise Digital AssistantsSoham Dasgupta
 
No-Java Enterprise Applications: It’s All About JavaScript [DEV5107]
No-Java Enterprise Applications: It’s All About JavaScript [DEV5107]No-Java Enterprise Applications: It’s All About JavaScript [DEV5107]
No-Java Enterprise Applications: It’s All About JavaScript [DEV5107]Soham Dasgupta
 
Javascript for Enterprise Application
Javascript for Enterprise ApplicationJavascript for Enterprise Application
Javascript for Enterprise ApplicationSoham Dasgupta
 
How the Dutch Police became “Chatbot” interactive
How the Dutch Police became “Chatbot” interactiveHow the Dutch Police became “Chatbot” interactive
How the Dutch Police became “Chatbot” interactiveSoham Dasgupta
 

More from Soham Dasgupta (6)

Are you testing your unit tests?
Are you testing your unit tests?Are you testing your unit tests?
Are you testing your unit tests?
 
Spring Native : Why not YET!
Spring Native : Why not YET!Spring Native : Why not YET!
Spring Native : Why not YET!
 
OneBot: A Comprehensive Case Study on Enterprise Digital Assistants
OneBot: A Comprehensive Case Study on Enterprise Digital AssistantsOneBot: A Comprehensive Case Study on Enterprise Digital Assistants
OneBot: A Comprehensive Case Study on Enterprise Digital Assistants
 
No-Java Enterprise Applications: It’s All About JavaScript [DEV5107]
No-Java Enterprise Applications: It’s All About JavaScript [DEV5107]No-Java Enterprise Applications: It’s All About JavaScript [DEV5107]
No-Java Enterprise Applications: It’s All About JavaScript [DEV5107]
 
Javascript for Enterprise Application
Javascript for Enterprise ApplicationJavascript for Enterprise Application
Javascript for Enterprise Application
 
How the Dutch Police became “Chatbot” interactive
How the Dutch Police became “Chatbot” interactiveHow the Dutch Police became “Chatbot” interactive
How the Dutch Police became “Chatbot” interactive
 

Recently uploaded

Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyJohn Staveley
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...CzechDreamin
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...Sri Ambati
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...Product School
 
Introduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationIntroduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationZilliz
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀DianaGray10
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxDavid Michel
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaRTTS
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsPaul Groth
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeCzechDreamin
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlPeter Udo Diehl
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Julian Hyde
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIES VE
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Alison B. Lowndes
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsExpeed Software
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...Product School
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...CzechDreamin
 

Recently uploaded (20)

Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Introduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationIntroduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG Evaluation
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT Professionals
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 

GraphQL-ify your APIs - Devoxx UK 2021

  • 2. Soham Dasgupta • Father, Husband and Football lover • Capgemini Netherlands • Oracle ACE • Tech Enthusiast/Programmer/Architect • Speaker & Blogger • Twitter : @iamsoham • LinkedIn: dasguptasoham • Github: sohamda • Medium: @iam.soham Who am I?
  • 3. What’s in store today GraphQL What Queries & Mutation Schemas & Types Show me some code graphql-java graphql-java-kickstart graphql-dgs-framework What’s better Implementation easiness – code, generation, error handling, testing, clients N+1 problem Memory footprint
  • 4. GraphQL is a query language for your API, and a server-side runtime for executing queries. Backed by your existing code and data. It was designed by Facebook to get around common constraints in fetching data via REST. It was open sourced by Facebook in 2015. Nothing to do with Graph DB. Not a replacement of REST. Not going to magically solve every API design issues. What’s GraphQL
  • 5. Schema Query Results Schema , Query & Results GraphQL provides description of the data in your API, gives clients the power to ask for exactly what they need.
  • 7. GraphQL vs REST API vs SOAP https://trends.google.com/trends/explore?date=today%205-y&q=%2Fg%2F11cn3w0w9t,REST%20API,%2Fm%2F077dn
  • 8. Hierarchical & Aggregator Strongly Typed Validation & Type check out-of-the-box API evolution without versioning GraphQL Characteristics
  • 9. Query & Mutation • Ask what you need. • Expand the same query. • Send arguments. • Use Aliases, Fragment Schemas & Types • GraphQL schema language - allows us to talk about GraphQL schemas in a language-agnostic way. • Scalar : Int, String, Boolean, ID, Float • Lists & Non-Null • Union, Interfaces, Input Types
  • 10. N+1 queries Caching complexity Community presence File Upload GraphQL Maturity
  • 11. Show me some code graphql-java graphql-java-kickstart graphql-dgs-framework
  • 13. graphql-java https://www.graphql-java.com/documentation/v17/ https://github.com/graphql-java - Version 17.3 : Last updated on Sep’21 https://github.com/graphql-java/graphql-java-spring
  • 19. What’s better Implementation easiness – code, generation, error handling, testing, clients N+1 problem Memory footprint
  • 20. DataFetchers graphql-java Piece of code that fetches the data graphql-java-kickstart dgs 1. Define a @Component which defines datafetching methods. 2. Register them in while building/parsing the schema 1. Define @Component which implements GraphQLQueryResolver. 2. For field-level define a @Component which implements GraphQLResolver<T>. 1. Define a @DgsComponent. 2. Map the schema operations with @DgsData
  • 21. DataLoaders graphql-java Piece of code that is responsible for N+1 query issue graphql-java-kickstart dgs 1. Define a BatchLoader which return s a CompletableFuture. 2. Define a DataLoaderRegistry @Bean which registers the Loader. 3. Define a DataFetcher using that Loader. 1. Define @Component which defines a loader and adds it to the registry. 2. Define a @Component which implements GraphQLServletContextBuild er and associate the registry. 1. Define a @DgsDataLoader. 2. Map the schema operations with @DgsData
  • 22. Mutations graphql-java Piece of code that persist the data graphql-java-kickstart dgs 1. Define a @Component which defines datafetching methods. 2. Register them in while building/parsing the schema • Define @Component which implements GraphQLMutationResolver. 1. Define a @DgsComponent. 2. Map the schema operations with @DgsData
  • 23. Error Handling graphql-java Piece of code that handles exceptions/errors graphql-java-kickstart dgs Implement GraphQLError 1. Enable ExceptionHandler property and handle them in a Spring way. 2. Implement GraphQLErrorHandler and manage the errors in overridden method. Define a @Component which implements DataFetcherExceptionHandle r
  • 24. Client graphql-java How to call a GraphQL API graphql-java-kickstart dgs 1. No defined way. 2. Needs text templates to generate requests. 1. Gives a Webclient library. 2. Needs text templates to generate requests. 1. GraphQLClient uses String as query which is same as the previous two. 2. Code generation using Gradle/Maven. This is the type- safe option.
  • 25. Testing graphql-java How to test your code graphql-java-kickstart dgs 1. No defined way. 2. Only can test the service-repo layer. 1. No defined way. 2. Only can test the service-repo layer. 1. Code generation using Gradle. This is the type-safe option. 2. Use the generated classes to build request and test using DgsAutoConfiguration class. graphql-java graphql-java-kickstart dgs 1. No defined way. 1. No defined way. 1. Code generation using Gradle/Maven. Code Generation
  • 26. Runtime memory & Image Size
  • 27. Final Words graphql-java graphql-java-kickstart dgs-framework • Is there since long, so evolved and matured. • A lot of Boilerplate code just to write a simple API. • Need extra library to work in Springboot. With other Java • Not a easy way to Unit Test everything you write. • No Clients avaiable. Need to use text templates to create queries. • Looks very matured but missing extended documentation. • Still a bit of Boilerplate code. • Directly usable within Springboot. Although other modules available to work on Java only environments. • Not a easy way to UT everything you write. • Basic Client avaiable. • Not sure about maturity, but Netflix is behind this, so faith is there. • No Boilerplate code. • Directly usable within Springboot. • You can UT everything you write. • Client avaiable. • Code generation using Gradle/Maven. https://medium.com/springboot-chronicles/graphql-in-springboot-a-comparative-study- among-the-libraries-and-their-implementation-know-how-b0e8d544f2fc
  • 28. This presentation contains information that may be privileged or confidential and is the property of the Capgemini Group. Copyright © 2021 Capgemini. All rights reserved. Capgemini is a global leader in partnering with companies to transform and manage their business by harnessing the power of technology. The Group is guided everyday by its purpose of unleashing human energy through technology for an inclusive and sustainable future. It is a responsible and diverse organization of 270,000 team members in nearly 50 countries. With its strong 50 year heritage and deep industry expertise, Capgemini is trusted by its clients to address the entire breadth of their business needs, from strategy and design to operations, fuelled by the fast evolving and innovative world of cloud, data, AI, connectivity, software, digital engineering and platforms. The Group reported in 2020 global revenues of €16 billion. About Capgemini Get the Future You Want | www.capgemini.com

Editor's Notes

  1. Who coded graphQL
  2. Some people call them resolvers as well.
  3. Or MapLoader. : is
  4. Some people call them resolvers as well.
  5. Or MapLoader. : is
  6. Or MapLoader. : is
  7. Or MapLoader. : is
  8. Or MapLoader. : is
  9. Or MapLoader. : is