-
Notifications
You must be signed in to change notification settings - Fork 317
Support pagination return values and pagination requests in @SchemaMapping
methods
#620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@SchemaMapping
methods
Hi @rstoyanchev, based on our previous discussion for Pageable and Also, I would like to contribute for the first time in the project so this could be the place for that, what are your thoughts? |
@SchemaMapping
methods@SchemaMapping
methods
We have worked with the Spring Data team to enable support for keyset and offset based scrolling through a result set, see spring-projects/spring-data-commons#2787. Now that it is available in snapshots, we've been able to both provide feedback to the Spring Data team, and to use the new API for GraphQL pagination. The main new concepts are |
@mladenjotanovichtec, apologies for the slow response, and thanks for the offer to help! As per my previous comment, Spring Data support has added new features for pagination, and we have evolved our plans accordingly. At the moment we are a bit too close to M1, and busy wrapping up, but there will be plenty of opportunities to contribute. We'll make an effort to call them out, but feel free to reach out as well. In the mean time we really do appreciate feedback on the new and existing features. |
@SchemaMapping
methods@SchemaMapping
methods
ConnectionTypeVisitor to decorate DataFetchers for Connection fields in order to adapt Window, Slice, and others to Connection. A ScrollRequest controller method argument to inject the ScrollPosition and the number of elements requested. SortStrategy for an application to customize how to extract sort details from GraphQL arguments. See gh-620
...to Subrange and ScrollSubrange See gh-620
For a completely generic SortStrategy we can't provide any concrete support we know neither the input structure nor the Object structure. At best, a nearly empty argument resolver, which is not any better than providing your own custom argument resolver. Hence, SortStrategy is now explicitly based on Spring Data's Sort, which enables us to provide concrete support with a base class. See gh-620
When a controller method returns
Page
we should adapt that tographql.relay.Connection
. Likewise, we should supportPageable
as a controller method argument, initialized from GraphQL input arguments.As part of that we'll need a strategy to encode and decode a cursor. This includes indicating sort order, even if the relay spec does not specify how to do that.
The text was updated successfully, but these errors were encountered: