Following the Spring GraphQL project announcement and the availability of a 1.0 milestone, this blog post aims to provide more details. If you’r

Introducing Spring GraphQL

submited by
Style Pass
2021-07-08 18:30:10

Following the Spring GraphQL project announcement and the availability of a 1.0 milestone, this blog post aims to provide more details.

If you’re looking to get started, please head over to our reference documentation and read the “Boot Starter” section, or run the samples.

GraphQL is widely adopted and in “Early Majority” based on the InfoQ Architecture Trends for 2020. It provides an alternative to REST APIs that is more focused on data, and provides a schema and a query language for clients to use. The appeal from a client perspective is clear in this State of JavaScript report. You can read GitHub’s story on why it uses GraphQL.

As Andy Marek wrote in the opening blog, Spring GraphQL was conceived as the successor of the GraphQL Java Spring project from the GraphQL Java team. This is why the initial focus of our collaboration was to match that functionality as well as integrate GraphQL Java and Spring in the best possible way.

The URL for a GraphQL endpoint is easy to secure as usual. For more fine-grained security, applications can use Spring Security annotations on data retrieval methods. This requires Spring Security context to propagate to data retrieval methods, and while GraphQL Java is neutral to threads, components in the execution can themselves be asynchronous and cause a switch of threads.

Leave a Comment