Skip to content

Spring for GraphQL 1.2

Rossen Stoyanchev edited this page May 17, 2023 · 4 revisions

What’s New in Spring for GraphQL 1.2

New Features

Pagination Support

First-class support for pagination, seamlessly adapting Spring Data pagination to the GraphQL Cursor Connection specification, including support for the latest Scroll API, new in Spring Data 2023.01. To learn more, start with the section on Pagination in the reference documentation, and follow links to other sections.

Schema Mapping Checks

You can enable inspection of GraphQL schema mappings on startup to detect schema fields with neither a DataFetcher nor a corresponding Java object property, and likewise to detect controller methods and DataFetcher registrations to non-existing fields. See the section on Schema Mappings Inpsection in the reference documentation.

Annotated Exception Handling

You can now handle exceptions from @SchemaMapping controller methods via @GraphQlExceptionHandler annotated handler methods declared and apply either locally in the controller, or in a @ControllerAdvice. For more, see the section on @GraphQlExceptionHandler in the reference documentation.

@Validated on method parameter

Validation via @Validated on method parameter is now supported as an alternative to @Valid if you need to specify validation groups for a specific parameter. Alternatively, @Validated can also be declared on the method or on the class level.

Upgrade and Migration Notes

@Argument Map<String, Object> no longer returns the full arguments map, and instead now always returns the raw argument value, matching either to the name specified in the annotation, or to the parameter name. For access to the full arguments map, please use @Arguments Map<String, Object> or DataFetchingEnvironment#getArguments.

Clone this wiki locally