This is a follow-up to https://github.com/spring-projects/spring-graphql/issues/619 and https://github.com/spring-projects/spring-graphql/issues/620, adding support for pagination and sorting.
I've discussed details of with @bclozel, and he plans to prepare a PR, but I'll add a summary here. Most changes should be in GraphQlAutoConfiguration to my understanding, sketched out as follows:
- Create
ConnectionTypeDefinitionConfigurerand set it onGraphQlSource.SchemaResourceBuilderto enable schema type generation of boilerplate types. - Declare a
CursorStrategy<ScrollPosition>bean, created fromScrollPositionCursorStrategyandJsonKeysetCursorStrategy, and wrapped viaCursorStrategy.withEncoderfor Base64 encoding, and use it as follows: - Set the respective property on
AnnotatedControllerConfigurer. - Create
ConnectionFieldTypeVisitorwithWindowConnectionAdapterandSliceConnectionAdapter, and add it toGraphQlSource.Builder.
Comment From: scottfrederick
Closing in favor of #34677