Contenu connexe


Boost your APIs with GraphQL

  1. Boost your APIs with GraphQL @jefrajames
  2. A few words about me { name: “Jean-François James”, company: “Worldline”, mainSkill: “Software Architect”, technicalFocus: “Java”, openSourceContribution: “Eclipse MicroProfile GraphQL” }
  3. • GraphQL origins • REST @ GraphQL • MicroProfile GraphQL • Demo: how to GraphQL with MicroProfile? • Next steps & conclusion Agenda
  4. 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
  5. 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
  6. Is REST that easy?
  7. • A specification: • Query language: query, mutation, subscription • Runtime • A reference implementation: • Multiple other implementations: What is
  8. • 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
  9. 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
  10. MicroProfile GraphQL WildFly Quarkus Open Liberty 1.0 1.0-M1Dec May Feb June Aug 2019 KICK OFF 2018 2020 EclipseCon Oct Andy McCright (IBM) Adam Anderson (IBM) Phillip Kruger (Red Hat) Bojan Tomic (SPQR) JF James (Worldine) JB Roux (Worldline)
  11. REST GraphQL DB Payment Scoring Merchant Contract Demo time!
  12. • 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
  13. • 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
  14. Thank you!
 Time for Q&A
  15. • TexShow Demo: • 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 • • • GraphQL and caching: The elephant in the room References