Today we released the first version of the new MicroProfile GraphQL specification that will reside outside of the MicroProfile Umbrella specification.
The intent of the MicroProfile GraphQL specification is to provide a “code-first” set of APIs that will enable users to quickly develop portable GraphQL-based applications in Java.
There are 2 main requirements for all implementations of this specification, namely:
- Generate and make the GraphQL Schema available. This is done by looking at the annotations in the users code, and must include all GraphQL Queries and Mutations as well as all entities as defined implicitly via the response type or argument(s) of Queries and Mutations.
- Execute GraphQL requests. This will be in the form of either a Query or a Mutation. As a minimum the specification must support executing these requests via HTTP.
Some of the features included in this version:
- Queries and Mutations – allows you to create queries (get data) and mutations (create/modify/delete data).
- Source queries – allows you to stitch together Queries on the boundary. A downstream query will be done, only if it’s part of the original request.
- Error Handling – Java exception mapping to GraphQL errors.
- Partial responses – allows a response to contain both partial results and errors for the fields that could not be fetched.
- Interface – support for interfaces on input types.
- Formatting – support for number and date formatting.
- Metadata – annotations for metadata (Name, Description, Non-null, Ignore etc.).
- JsonB – support for JsonB annotations.
Read the full specification here: https://download.eclipse.org/microprofile/microprofile-graphql-1.0/microprofile-graphql.html
Want to know more? See this blog post that goes into more technical detail.