SlideShare ist ein Scribd-Unternehmen logo
1 von 28
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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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)
 

Ähnlich wie 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
 

Ähnlich wie 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)
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Kürzlich hochgeladen (20)

Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 

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

Hinweis der Redaktion

  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