Issue
I'm calling a service that exposes a GraphQL interface. So I'm able to post a GraphQL query and receive data back via curl. Now I want to write a service that builds the query for me (dynamically, based on query parameters I send my endpoint) and sends the request and gets the response back.
I'm using Spring Boot 2.1.4.
I know you can build queries with the elastic search library in Spring. Wondering if there's something similar for GraphQL.
Solution
There's a few clients, taking rather different approaches.
- SmallRye GraphQL offers both a dynamic and a typesafe client
- Netflix DGS client - Has both a simple and a type-safe client
- Apollo Android - Not Android specific, despite the name.
- There's a Node based Java client generator and a Maven plugin for it too.
- Nodes
- Shopify's GraphQL code gen - Needs (J)Ruby to run but generates Java code.
- Manifold can be used as a GraphQL client
These are all different beasts, as you'll see, so you'll have to decide what fits.
Answered By - kaqqao
Answer Checked By - Robin (JavaFixing Admin)