Spring GraphQL hits new milestone towards 1.0.0 release

The Spring GraphQL team has released Spring GraphQL 1.0.0-M3, which it heralds as the third milestone towards a 1.0.0 release for the project.

Spring GraphQL aims to provide support for Spring applications built on GraphQL Java, and is a joint collaboration between the two project teams. Spring GraphQL is being developed as the successor for the GraphQL Java Spring project from the GraphQL Java team and is intended to form the foundation for all future applications using Spring and GraphQL.

This milestone adds several enhancements as the Spring GraphQL team works towards reaching the 1.0.0 release of the project.

This release adds a new BatchMapping method that follows on from the annotation programming model for GraphQL data controllers with SchemaMapping methods introduced in the second milestone. According to the Spring Blog, this provides dedicated support for batching to address the N+1 select problem when queries against the graph of data are run.

Also added is built-in support for TypeResolver functions for GraphQL Unions and Interfaces. This tries to match the simple name of a Java class to a GraphQL Object type, and it tries the same for super types in the hierarchy of the class. Options are available to customise this capability in order to provide sufficient hints to match concrete Java classes to GraphQL Object types, and the Spring GraphQL team is seeking feedback on how well this feature works and whether more flexibility is required.

There is also now a WebSocketInterceptor sub-type of WebInterceptor which can handle the CONNECTION_INIT and COMPLETE messages on a WebSocket connection, including access to the CONNECTION_INIT payload along with the ability to reject the connection. This is another feature on which the Spring GraphQL team is seeking feedback, as it works towards the 1.0.0 release.

Meanwhile, Spring GraphQL now uses the Spring Framework DataBinder mechanism to turn maps of data into the typed objects declared on an Argument controller method parameter. These maps are generated by the parsing of input arguments by GraphQL Java.

Other improvements and fixes include the Spring GraphQL Boot starter providing properties to configure CORS for GraphQL endpoints, and enhancements to the GraphQlTester API and the testing auto-configuration. A full list of all the additions can be found at the Spring GraphQL GitHub repository.