This presentation is about Web APIs in general and MicroProfile GraphQL in particular. It has been used for EclipseCon 2020 and is backed by a GitHub project (link on slide 11).
A few words about me
{
name: “Jean-François James”,
company: “Worldline”,
mainSkill: “Software Architect”,
technicalFocus: “Java”,
openSourceContribution: “Eclipse MicroProfile GraphQL”
}
• GraphQL origins
• REST @ GraphQL
• MicroProfile GraphQL
• Demo: how to GraphQL with MicroProfile?
• Next steps & conclusion
Agenda
The origins
A specification
Created at Facebook in 2012
Open sourced in July 2015
Adopted by GitHub in 2016
Moved to the GraphQL Foundation eof 2018
REpresentational State Transfer
Widely adopted
Strong ecosystem
Defined in 2000
An architecture style for modern Web apps
REST & GraphQL
REST GraphQL
Core concept Resource Schema (strongly-typed)
Endpoint Multiple Single (generic & query-able)
Leverage HTTP Yes No
API Documentation OpenAPI Built-in (schema-based)
Data selection/request No Yes
Multiple queries No Yes
Partial results No Yes
• A specification: http://spec.graphql.org
• Query language: query, mutation, subscription
• Runtime
• A reference implementation: https://github.com/graphql/graphql-js
• Multiple other implementations: http://graphql.org/code
What is
• Not about databases:
– A way to talk to Web APIs
– Intended to sit on top of your business logic
• Not about “formal Graphs”:
– Doesn’t mandate to model data in terms of nodes, edges, explicit
relationships
– Naturally interconnected data, super-clear capabilities of the API
What is not GraphQL
MicroProfile overview
GraphQL Config
Fault
Tolerance
Fallback
Retry
Timeout
Circuit breaker
Bulkhead
OpenAPI
Rest
Client
JWT
Web API
Health
Metrics
Open
Tracing
Observability
Reactive
Messaging
Reactive
Streams
Context
Propagation
Long Running
Action
Core (3.3)
JAX-RS CDI
JSON-P
JSON-B
Standalone
specs
Jakarta EE (ex Java EE) foundation
• Client-side APIs: high level + dynamic
• Better integration with other MP specs
• Pagination made easy
• GraphQL Context injection
• GraphQL DataLoader for complex queries
• Query-cost analysis?
MicroProfile GraphQL next steps
• GraphQL use-cases:
– Rich data models, data-intensive APIs
– Aggregation of data sources and services
– Flexibility & diversity on the client-side
• Challenges for GraphQL adoption:
– A new technology to introduce
– Schema design
– Revisited API management
• MicroProfile aims at facilitating your GraphQL adoption!
Conclusion
• TexShow Demo: https://github.com/jefrajames/texshow
• GraphQL: Designing a Data Language by Lee Byron
• GraphQL et pour quoi faire by Octo Talk
• REST API Design - Resource Modeling by ThoughtWorks
• GraphQL best practises by Manish Jain
• A query language for your API by Bhargav Anakdat
• Architecture styles and the design of network-based architectures by Roy Fielding
• https://nordicapis.com/interview-with-graphql-co-creator-lee-byron/
• https://restfulapi.net/
• GraphQL and caching: The elephant in the room
References