SlideShare une entreprise Scribd logo
1  sur  59
Télécharger pour lire hors ligne
Andreas Marek
Rossen Stoyanchev
Spring GraphQL
Copyright © 2021 VMware, Inc. or its affiliates.
Who are we
Andreas Marek
● GraphQL Java creator and maintainer
● GraphQL contributor and Technical Steering
Committee member
● Spring GraphQL co-creator
● Working at Atlassian, Sydney
● @andimarek on twitter and github
Rossen Stoyanchev
● Spring Framework committer - Spring MVC,
WebFlux, web messaging, RSocket
● RSocket Java committer
● Spring GraphQL co-creator
● Working at VMware, Cambridge, UK
● @rstoya05 on twitter
Cover w/ Image
Agenda
● What is GraphQL?
● GraphQL Java
● Spring GraphQL
What is GraphQL?
What is GraphQL?
GraphQL is a technology for client server data exchange
● A clients wants to access data on a server (across a network)
● Originally developed by Facebook for their iOS app in 2012
● Open sourced in 2015, governed by a non profit foundation today
● Two pillars: statically typed API + query language
● Sweet spots are Single Page Apps and native clients
● An alternative to REST(ish) APIs
● My favourite argument for GraphQL: the developer experience
GraphiQL demo
GraphQL Java
Data Fetching Layer
HTTP
Web iOS Android
Cache Microservices DB
The two pillars of GraphQL
GraphQL Schema
● Describes your API
● Defined on the server
● Based on a simple static types system
● Schema Definition Language (SDL) is used to
describe a Schema
GraphQL Query Language
● Custom query language
● Clients define the query based on their needs
● Every field needs to be requested explicitly
GraphQL Schema
Example
GraphQL Query
Example
The GraphQL ecosystem
GraphQL ecosystem is based on a specification
● The GraphQL specification defines how GraphQL queries should be executed
● It defines the GraphQL schema + query language
● First there was the spec + reference implementation in JS (GraphQL.JS)
● Next it was implemented in every major language
GraphQL Java
GraphQL Java
GraphQL Java is the GraphQL implementation for Java
● It is an implementation for the server side GraphQL execution (also called execution
engine)
● Started mid 2015
● Pure engine: no HTTP or IO. No high level abstracts.
● Used word wide and empowers a whole ecosystem of libraries build on top
● https://graphql-java.com/
How to think in GraphQL Java
Schema first and DataFetchers
● Start designing by putting the Schema first
● Use case and client oriented
● Define the schema in SDL (textual format, preferred) or programmatically
● Schema is made out of types with fields
● Fundamental rule: every field has a DataFetcher associated with
● DataFetcher fetches the data for one field
● If you don’t specify a DataFetcher a default DataFetcher is provided
PropertyDataFetcher
PropertyDataFetcher
DataFetcher
Calling the employee service
DataFetcher
Calling the department service
DataFetcher
Calling the employee service
1 Query.allEmployees
2a Employee.id
2b Employee.name
2c Employee.department
3a Department.name
3b Department.employees
4 Employee.id
Request Execution: DataFetchers sequence
From GraphQL Java to Spring GraphQL
Spring GraphQL is the missing gap in the developer story
● GraphQL Java is “limited” on purpose
● GraphQL Java lets you do everything, but not everything is as simple and convenient
as possible
● The Spring and GraphQL Java teams came together to fix that
● Spring GraphQL is focused on comprehensive and first level support
● It aims to be a fundamental building block build directly on GraphQL Java
Spring GraphQL
Transport ?
GraphQL Java
Engine
Data Fetchers
Database Message
Broker
Microservice
GraphQL Java
GraphQL Java
HTTP,
WebSocket
GraphQL Java
Engine
Data Fetchers
Database Message
Broker
Microservice
Spring MVC
Spring WebFlux
HTTP,
WebSocket
GraphQL Java
Engine
Data Fetchers
Database Message
Broker
Microservice
Initialization
Context propagation
Security
Exception resolution
Spring MVC
Spring WebFlux
GraphQL Java
Engine
Data Fetchers
Database Message
Broker
Microservice
@Controller
Querydsl
HTTP,
WebSocket
Spring MVC
Spring WebFlux
Initialization
Context propagation
Security
Exception resolution
GraphQL Java
Engine
Data Fetchers
Database Message
Broker
Microservice
HTTP,
WebSocket
Testing
@Controller
Querydsl repositories
Spring MVC
Spring WebFlux
Initialization
Context propagation
Security
Exception resolution
GraphQL Java
Engine
Data Fetchers
Database Message
Broker
Microservice
Boot Starter
Testing
@Controller
Querydsl repositories
Spring MVC
Spring WebFlux
Initialization
Context propagation
Security
Exception resolution
HTTP,
WebSocket
Customize ExecutionInput
Inspect ExecutionResult
Web Transports
WebMvc + WebFlux
Functional HTTP
Handlers
WebSocket
Handlers
WebInterceptor WebInterceptor GraphQlService graphql.GraphQL
Functional HTTP
Handlers
WebSocket
Handlers
WebInterceptor WebInterceptor GraphQlService graphql.GraphQL
Reactor API
Async Execution
Mono from CompletableFuture
Web Transports
WebMvc + WebFlux
GraphQL Java
Engine
Data
Fetchers
Service Service Service
HTTP, WebSocket
Handlers
Spring Security
Filter Chain
@PreAuthorize
@Secured
Security
Security and Context Propagation
Spring MVC
ThreadLocal context propagation from
Servlet container thread
Need to register ThreadLocalAccessor
Built-in accessor for Spring Security context
Spring WebFlux
Reactor context propagation from web layer
Spring Security context propagated
GraphQL Java
Engine
Data
Fetchers
Service Service Service
HTTP, WebSocket
Handlers
Spring Security
Filter Chain
@PreAuthorize
@Secured
Security
Context Propagation
Data Layer
The DataFetcher Contract
DataFetcher<T>
DataFetcher<T>
DataFetcher<T>
DataFetcher Wiring to Schema Fields
type: Query, field: allEmployees
type = Department, field = employees
type = Mutation, field = updateSalary
Exception Handling
GraphQL Java allows registering a single DataFetcherExceptionHandler
Spring GraphQL enables a DataFetcherExceptionResolver chain
DataFetcherExceptionResolver
ExceptionResolversExceptionHandler
DataFetcherExceptionResolver
DataFetcherExceptionResolver
Querydsl
Typesafe way to express queries in Java that works across multiple data stores
Spring Data has support for Querydsl
Spring GraphQL and Querydsl
QuerydslDataFetcher
Adapts a Spring Data repository to DataFetcher
Translates GraphQL query parameters to Querydsl Predicate
Adapt the Repository to
a DataFetcher
Match based on query return type for
top-level queries
Automatic Registration
More on Querydsl
Customize how GraphQL request parameters are mapped to Querydsl Predicate
Transform the resulting Objects via interface and DTO projections
GraphQlTester
Workflow for testing GraphQL
Automatic checks to verify no errors in response
Use JsonPath to specify data to inspect
Data decoding
WebGraphQlTester
Extension for GraphQL tests over web transports
Specify HTTP specific inputs
Uses WebTestClient
Spring Boot Starter
Dependencies
Autoconfig
Properties
Metrics
GraphiQL UI and Schema pages
Spring Boot Starter
Currently In Spring GraphQL repository, group id ‘org.springframework.experimental’
Due to move to Spring Boot, after version 2.6 is released
Collaboration with Netflix DGS
Optional, alternative starter to run DGS on the spring-graphql core
DGS programming model + spring-graphql WebMvc / WebFlux foundation
spring-graphql starter to become the main starter eventually
Netflix DGS Features
Annotation based registration of data fetchers, data loaders, scalars, etc.
Code generation for GraphQL Schema -> Java/Kotlin
GraphQL client for Java/Kotlin
Federation
Roadmap Timeline
M3: mid-October
Starter integrated into Spring Boot, after 2.6 release
RC phase: early 2022
GA: May 2022 with Spring Boot 2.7
Roadmap Features
Evolve controller programming model, #63 (batch loaders), #110 (bean validation)
Automated registration of Spring Data repositories, #99
Query by Example (QBE) support as an alternative to Querydsl, #115
GraphQL client, #10
More...
Roadmap Features
Your feedback
Thank you
Andreas Marek @andimarek
Rossen Stoyanchev @rstoya05
© 2021 Spring. A VMware-backed project.

Contenu connexe

Tendances

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
 
Building Modern APIs with GraphQL
Building Modern APIs with GraphQLBuilding Modern APIs with GraphQL
Building Modern APIs with GraphQLAmazon Web Services
 
Graphql presentation
Graphql presentationGraphql presentation
Graphql presentationVibhor Grover
 
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
 
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
 
How to GraphQL
How to GraphQLHow to GraphQL
How to GraphQLTomasz Bak
 
GraphQL Introduction
GraphQL IntroductionGraphQL Introduction
GraphQL IntroductionSerge Huber
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQLRodrigo Prates
 
GraphQL Introduction with Spring Boot
GraphQL Introduction with Spring BootGraphQL Introduction with Spring Boot
GraphQL Introduction with Spring Bootvipin kumar
 
Wroclaw GraphQL - GraphQL in Java
Wroclaw GraphQL - GraphQL in JavaWroclaw GraphQL - GraphQL in Java
Wroclaw GraphQL - GraphQL in JavaMarcinStachniuk
 
The Apollo and GraphQL Stack
The Apollo and GraphQL StackThe Apollo and GraphQL Stack
The Apollo and GraphQL StackSashko Stubailo
 
Better APIs with GraphQL
Better APIs with GraphQL Better APIs with GraphQL
Better APIs with GraphQL Josh Price
 

Tendances (20)

Intro to GraphQL
 Intro to GraphQL Intro to GraphQL
Intro to GraphQL
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQL
 
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
 
Building Modern APIs with GraphQL
Building Modern APIs with GraphQLBuilding Modern APIs with GraphQL
Building Modern APIs with GraphQL
 
Graphql presentation
Graphql presentationGraphql presentation
Graphql presentation
 
GraphQL
GraphQLGraphQL
GraphQL
 
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)
 
GraphQL Fundamentals
GraphQL FundamentalsGraphQL Fundamentals
GraphQL Fundamentals
 
An intro to GraphQL
An intro to GraphQLAn intro to GraphQL
An intro to GraphQL
 
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...
 
How to GraphQL
How to GraphQLHow to GraphQL
How to GraphQL
 
React & GraphQL
React & GraphQLReact & GraphQL
React & GraphQL
 
GraphQL Introduction
GraphQL IntroductionGraphQL Introduction
GraphQL Introduction
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQL
 
GraphQL Introduction with Spring Boot
GraphQL Introduction with Spring BootGraphQL Introduction with Spring Boot
GraphQL Introduction with Spring Boot
 
Wroclaw GraphQL - GraphQL in Java
Wroclaw GraphQL - GraphQL in JavaWroclaw GraphQL - GraphQL in Java
Wroclaw GraphQL - GraphQL in Java
 
The Apollo and GraphQL Stack
The Apollo and GraphQL StackThe Apollo and GraphQL Stack
The Apollo and GraphQL Stack
 
Intro GraphQL
Intro GraphQLIntro GraphQL
Intro GraphQL
 
Better APIs with GraphQL
Better APIs with GraphQL Better APIs with GraphQL
Better APIs with GraphQL
 
Apollo Server
Apollo ServerApollo Server
Apollo Server
 

Similaire à Spring GraphQL

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
 
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
 
GraphQL_devoxx_2023.pptx
GraphQL_devoxx_2023.pptxGraphQL_devoxx_2023.pptx
GraphQL_devoxx_2023.pptxSoham Dasgupta
 
Create GraphQL server with apolloJS
Create GraphQL server with apolloJSCreate GraphQL server with apolloJS
Create GraphQL server with apolloJSJonathan Jalouzot
 
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
 
GraphQL-ify your API - JFall 2022
GraphQL-ify your API - JFall 2022GraphQL-ify your API - JFall 2022
GraphQL-ify your API - JFall 2022Soham Dasgupta
 
Kotlin REST & GraphQL API
Kotlin REST & GraphQL APIKotlin REST & GraphQL API
Kotlin REST & GraphQL APISean O'Brien
 
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 performanceRed Hat
 
GraphQL over REST at Reactathon 2018
GraphQL over REST at Reactathon 2018GraphQL over REST at Reactathon 2018
GraphQL over REST at Reactathon 2018Sashko Stubailo
 
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
 
Spring Update | July 2023
Spring Update | July 2023Spring Update | July 2023
Spring Update | July 2023VMware Tanzu
 
Graph ql subscriptions on the jvm
Graph ql subscriptions on the jvmGraph ql subscriptions on the jvm
Graph ql subscriptions on the jvmGerard Klijs
 
wepik-enhancing-web-development-with-nodejs-graphql-a-practical-guide-2024041...
wepik-enhancing-web-development-with-nodejs-graphql-a-practical-guide-2024041...wepik-enhancing-web-development-with-nodejs-graphql-a-practical-guide-2024041...
wepik-enhancing-web-development-with-nodejs-graphql-a-practical-guide-2024041...AllstuffRj
 
Confoo - Javascript Server Side : How to start
Confoo - Javascript Server Side : How to startConfoo - Javascript Server Side : How to start
Confoo - Javascript Server Side : How to startQuentin Adam
 
GraphQL API Crafts presentation
GraphQL API Crafts presentationGraphQL API Crafts presentation
GraphQL API Crafts presentationSudheer J
 
Training Week: GraphQL 2022
Training Week: GraphQL 2022Training Week: GraphQL 2022
Training Week: GraphQL 2022Neo4j
 

Similaire à Spring GraphQL (20)

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
 
GraphQL-ify your APIs
GraphQL-ify your APIsGraphQL-ify your APIs
GraphQL-ify your APIs
 
Boost your API with GraphQL
Boost your API with GraphQLBoost your API with GraphQL
Boost your API with GraphQL
 
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_devoxx_2023.pptx
GraphQL_devoxx_2023.pptxGraphQL_devoxx_2023.pptx
GraphQL_devoxx_2023.pptx
 
Create GraphQL server with apolloJS
Create GraphQL server with apolloJSCreate GraphQL server with apolloJS
Create GraphQL server with apolloJS
 
GraphQL-ify your APIs
GraphQL-ify your APIsGraphQL-ify your APIs
GraphQL-ify your APIs
 
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 APIs with GraphQL
Boost your APIs with GraphQLBoost your APIs with GraphQL
Boost your APIs with GraphQL
 
GraphQL-ify your API - JFall 2022
GraphQL-ify your API - JFall 2022GraphQL-ify your API - JFall 2022
GraphQL-ify your API - JFall 2022
 
Kotlin REST & GraphQL API
Kotlin REST & GraphQL APIKotlin REST & GraphQL API
Kotlin REST & GraphQL API
 
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
 
GraphQL over REST at Reactathon 2018
GraphQL over REST at Reactathon 2018GraphQL over REST at Reactathon 2018
GraphQL over REST at Reactathon 2018
 
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
 
Spring Update | July 2023
Spring Update | July 2023Spring Update | July 2023
Spring Update | July 2023
 
Graph ql subscriptions on the jvm
Graph ql subscriptions on the jvmGraph ql subscriptions on the jvm
Graph ql subscriptions on the jvm
 
wepik-enhancing-web-development-with-nodejs-graphql-a-practical-guide-2024041...
wepik-enhancing-web-development-with-nodejs-graphql-a-practical-guide-2024041...wepik-enhancing-web-development-with-nodejs-graphql-a-practical-guide-2024041...
wepik-enhancing-web-development-with-nodejs-graphql-a-practical-guide-2024041...
 
Confoo - Javascript Server Side : How to start
Confoo - Javascript Server Side : How to startConfoo - Javascript Server Side : How to start
Confoo - Javascript Server Side : How to start
 
GraphQL API Crafts presentation
GraphQL API Crafts presentationGraphQL API Crafts presentation
GraphQL API Crafts presentation
 
Training Week: GraphQL 2022
Training Week: GraphQL 2022Training Week: GraphQL 2022
Training Week: GraphQL 2022
 

Plus de VMware Tanzu

What AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About ItWhat AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About ItVMware Tanzu
 
Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023VMware Tanzu
 
Enhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at ScaleEnhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at ScaleVMware Tanzu
 
Platforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a ProductPlatforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a ProductVMware Tanzu
 
Building Cloud Ready Apps
Building Cloud Ready AppsBuilding Cloud Ready Apps
Building Cloud Ready AppsVMware Tanzu
 
Spring Boot 3 And Beyond
Spring Boot 3 And BeyondSpring Boot 3 And Beyond
Spring Boot 3 And BeyondVMware Tanzu
 
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdfSpring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdfVMware Tanzu
 
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023VMware Tanzu
 
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023VMware Tanzu
 
tanzu_developer_connect.pptx
tanzu_developer_connect.pptxtanzu_developer_connect.pptx
tanzu_developer_connect.pptxVMware Tanzu
 
Tanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - FrenchTanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - FrenchVMware Tanzu
 
Tanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - EnglishTanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - EnglishVMware Tanzu
 
Virtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - EnglishVirtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - EnglishVMware Tanzu
 
Tanzu Developer Connect - French
Tanzu Developer Connect - FrenchTanzu Developer Connect - French
Tanzu Developer Connect - FrenchVMware Tanzu
 
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023VMware Tanzu
 
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring BootSpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring BootVMware Tanzu
 
SpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software EngineerSpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software EngineerVMware Tanzu
 
SpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs PracticeSpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs PracticeVMware Tanzu
 
SpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense SolutionsSpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense SolutionsVMware Tanzu
 
SpringOne Tour: Doing Progressive Delivery with your Team
SpringOne Tour: Doing Progressive Delivery with your TeamSpringOne Tour: Doing Progressive Delivery with your Team
SpringOne Tour: Doing Progressive Delivery with your TeamVMware Tanzu
 

Plus de VMware Tanzu (20)

What AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About ItWhat AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About It
 
Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023
 
Enhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at ScaleEnhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at Scale
 
Platforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a ProductPlatforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a Product
 
Building Cloud Ready Apps
Building Cloud Ready AppsBuilding Cloud Ready Apps
Building Cloud Ready Apps
 
Spring Boot 3 And Beyond
Spring Boot 3 And BeyondSpring Boot 3 And Beyond
Spring Boot 3 And Beyond
 
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdfSpring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
 
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
 
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
 
tanzu_developer_connect.pptx
tanzu_developer_connect.pptxtanzu_developer_connect.pptx
tanzu_developer_connect.pptx
 
Tanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - FrenchTanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - French
 
Tanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - EnglishTanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - English
 
Virtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - EnglishVirtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - English
 
Tanzu Developer Connect - French
Tanzu Developer Connect - FrenchTanzu Developer Connect - French
Tanzu Developer Connect - French
 
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
 
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring BootSpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
 
SpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software EngineerSpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software Engineer
 
SpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs PracticeSpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs Practice
 
SpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense SolutionsSpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
 
SpringOne Tour: Doing Progressive Delivery with your Team
SpringOne Tour: Doing Progressive Delivery with your TeamSpringOne Tour: Doing Progressive Delivery with your Team
SpringOne Tour: Doing Progressive Delivery with your Team
 

Dernier

Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyAnusha Are
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedDelhi Call girls
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxalwaysnagaraju26
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...Nitya salvi
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfryanfarris8
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456KiaraTiradoMicha
 

Dernier (20)

Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodology
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
 

Spring GraphQL

  • 1. Andreas Marek Rossen Stoyanchev Spring GraphQL Copyright © 2021 VMware, Inc. or its affiliates.
  • 2. Who are we Andreas Marek ● GraphQL Java creator and maintainer ● GraphQL contributor and Technical Steering Committee member ● Spring GraphQL co-creator ● Working at Atlassian, Sydney ● @andimarek on twitter and github Rossen Stoyanchev ● Spring Framework committer - Spring MVC, WebFlux, web messaging, RSocket ● RSocket Java committer ● Spring GraphQL co-creator ● Working at VMware, Cambridge, UK ● @rstoya05 on twitter
  • 3. Cover w/ Image Agenda ● What is GraphQL? ● GraphQL Java ● Spring GraphQL
  • 5. What is GraphQL? GraphQL is a technology for client server data exchange ● A clients wants to access data on a server (across a network) ● Originally developed by Facebook for their iOS app in 2012 ● Open sourced in 2015, governed by a non profit foundation today ● Two pillars: statically typed API + query language ● Sweet spots are Single Page Apps and native clients ● An alternative to REST(ish) APIs ● My favourite argument for GraphQL: the developer experience
  • 7. GraphQL Java Data Fetching Layer HTTP Web iOS Android Cache Microservices DB
  • 8. The two pillars of GraphQL GraphQL Schema ● Describes your API ● Defined on the server ● Based on a simple static types system ● Schema Definition Language (SDL) is used to describe a Schema GraphQL Query Language ● Custom query language ● Clients define the query based on their needs ● Every field needs to be requested explicitly
  • 10.
  • 12. The GraphQL ecosystem GraphQL ecosystem is based on a specification ● The GraphQL specification defines how GraphQL queries should be executed ● It defines the GraphQL schema + query language ● First there was the spec + reference implementation in JS (GraphQL.JS) ● Next it was implemented in every major language
  • 14. GraphQL Java GraphQL Java is the GraphQL implementation for Java ● It is an implementation for the server side GraphQL execution (also called execution engine) ● Started mid 2015 ● Pure engine: no HTTP or IO. No high level abstracts. ● Used word wide and empowers a whole ecosystem of libraries build on top ● https://graphql-java.com/
  • 15. How to think in GraphQL Java Schema first and DataFetchers ● Start designing by putting the Schema first ● Use case and client oriented ● Define the schema in SDL (textual format, preferred) or programmatically ● Schema is made out of types with fields ● Fundamental rule: every field has a DataFetcher associated with ● DataFetcher fetches the data for one field ● If you don’t specify a DataFetcher a default DataFetcher is provided
  • 16.
  • 17. PropertyDataFetcher PropertyDataFetcher DataFetcher Calling the employee service DataFetcher Calling the department service DataFetcher Calling the employee service
  • 18. 1 Query.allEmployees 2a Employee.id 2b Employee.name 2c Employee.department 3a Department.name 3b Department.employees 4 Employee.id Request Execution: DataFetchers sequence
  • 19. From GraphQL Java to Spring GraphQL Spring GraphQL is the missing gap in the developer story ● GraphQL Java is “limited” on purpose ● GraphQL Java lets you do everything, but not everything is as simple and convenient as possible ● The Spring and GraphQL Java teams came together to fix that ● Spring GraphQL is focused on comprehensive and first level support ● It aims to be a fundamental building block build directly on GraphQL Java
  • 21. Transport ? GraphQL Java Engine Data Fetchers Database Message Broker Microservice GraphQL Java
  • 22. GraphQL Java HTTP, WebSocket GraphQL Java Engine Data Fetchers Database Message Broker Microservice Spring MVC Spring WebFlux
  • 23. HTTP, WebSocket GraphQL Java Engine Data Fetchers Database Message Broker Microservice Initialization Context propagation Security Exception resolution Spring MVC Spring WebFlux
  • 24. GraphQL Java Engine Data Fetchers Database Message Broker Microservice @Controller Querydsl HTTP, WebSocket Spring MVC Spring WebFlux Initialization Context propagation Security Exception resolution
  • 25. GraphQL Java Engine Data Fetchers Database Message Broker Microservice HTTP, WebSocket Testing @Controller Querydsl repositories Spring MVC Spring WebFlux Initialization Context propagation Security Exception resolution
  • 26. GraphQL Java Engine Data Fetchers Database Message Broker Microservice Boot Starter Testing @Controller Querydsl repositories Spring MVC Spring WebFlux Initialization Context propagation Security Exception resolution HTTP, WebSocket
  • 27. Customize ExecutionInput Inspect ExecutionResult Web Transports WebMvc + WebFlux Functional HTTP Handlers WebSocket Handlers WebInterceptor WebInterceptor GraphQlService graphql.GraphQL
  • 28. Functional HTTP Handlers WebSocket Handlers WebInterceptor WebInterceptor GraphQlService graphql.GraphQL Reactor API Async Execution Mono from CompletableFuture Web Transports WebMvc + WebFlux
  • 29.
  • 30. GraphQL Java Engine Data Fetchers Service Service Service HTTP, WebSocket Handlers Spring Security Filter Chain @PreAuthorize @Secured Security
  • 31. Security and Context Propagation Spring MVC ThreadLocal context propagation from Servlet container thread Need to register ThreadLocalAccessor Built-in accessor for Spring Security context Spring WebFlux Reactor context propagation from web layer Spring Security context propagated
  • 32. GraphQL Java Engine Data Fetchers Service Service Service HTTP, WebSocket Handlers Spring Security Filter Chain @PreAuthorize @Secured Security Context Propagation
  • 36.
  • 37.
  • 38.
  • 39. type: Query, field: allEmployees
  • 40. type = Department, field = employees
  • 41. type = Mutation, field = updateSalary
  • 42. Exception Handling GraphQL Java allows registering a single DataFetcherExceptionHandler Spring GraphQL enables a DataFetcherExceptionResolver chain DataFetcherExceptionResolver ExceptionResolversExceptionHandler DataFetcherExceptionResolver DataFetcherExceptionResolver
  • 43.
  • 44. Querydsl Typesafe way to express queries in Java that works across multiple data stores Spring Data has support for Querydsl
  • 45. Spring GraphQL and Querydsl QuerydslDataFetcher Adapts a Spring Data repository to DataFetcher Translates GraphQL query parameters to Querydsl Predicate
  • 46. Adapt the Repository to a DataFetcher
  • 47. Match based on query return type for top-level queries Automatic Registration
  • 48. More on Querydsl Customize how GraphQL request parameters are mapped to Querydsl Predicate Transform the resulting Objects via interface and DTO projections
  • 49. GraphQlTester Workflow for testing GraphQL Automatic checks to verify no errors in response Use JsonPath to specify data to inspect Data decoding
  • 50. WebGraphQlTester Extension for GraphQL tests over web transports Specify HTTP specific inputs Uses WebTestClient
  • 51.
  • 53. Spring Boot Starter Currently In Spring GraphQL repository, group id ‘org.springframework.experimental’ Due to move to Spring Boot, after version 2.6 is released
  • 54. Collaboration with Netflix DGS Optional, alternative starter to run DGS on the spring-graphql core DGS programming model + spring-graphql WebMvc / WebFlux foundation spring-graphql starter to become the main starter eventually
  • 55. Netflix DGS Features Annotation based registration of data fetchers, data loaders, scalars, etc. Code generation for GraphQL Schema -> Java/Kotlin GraphQL client for Java/Kotlin Federation
  • 56. Roadmap Timeline M3: mid-October Starter integrated into Spring Boot, after 2.6 release RC phase: early 2022 GA: May 2022 with Spring Boot 2.7
  • 57. Roadmap Features Evolve controller programming model, #63 (batch loaders), #110 (bean validation) Automated registration of Spring Data repositories, #99 Query by Example (QBE) support as an alternative to Querydsl, #115 GraphQL client, #10 More...
  • 59. Thank you Andreas Marek @andimarek Rossen Stoyanchev @rstoya05 © 2021 Spring. A VMware-backed project.