Skip to content

Configure support for GraphQL pagination and sorting #34677

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

Closed
wants to merge 1 commit into from

Conversation

bclozel
Copy link
Member

@bclozel bclozel commented Mar 21, 2023

This commit auto-configures the new pagination and sorting support for
Spring for GraphQL, if Spring Data is available.
The GraphQlAutoConfiguration now contributes a CursorStrategy bean
that is used to set up the pagination and sorting data fetching
infrastructure.

This commit also configures by default a
ConnectionTypeDefinitionConfigurer that automatically detects
*Connection types and contributes the relevant schema definitions
according to the Relay spec.

Closes gh-34630

@bclozel
Copy link
Member Author

bclozel commented Mar 21, 2023

Hey @rstoyanchev - here's a first draft for the pagination and sorting support in Spring Boot. Is that what you had in mind?

Copy link
Contributor

@rstoyanchev rstoyanchev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks straight forward, just one comment below. In addition, I think I'll make the CursorStrategy detected in AnnotatedControllerConfigurer for consistency with the SortStrategy.

This commit auto-configures the new pagination and sorting support for
Spring for GraphQL, if Spring Data is available.
The `GraphQlAutoConfiguration` now contributes a `CursorStrategy` bean
that is used to set up the pagination and sorting data fetching
infrastructure.

This commit also configures by default a
`ConnectionTypeDefinitionConfigurer` that automatically detects
`*Connection` types and contributes the relevant schema definitions
according to the Relay spec.

Closes spring-projectsgh-34630
@bclozel
Copy link
Member Author

bclozel commented Mar 21, 2023

I've just updated my PR with the latest comments.

@bclozel bclozel marked this pull request as ready for review March 21, 2023 13:54
Copy link
Member

@wilkinsona wilkinsona left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. @rstoyanchev, unless you think some further tweaks are required, we'll try to get this into Thursday's M2 release.

@rstoyanchev
Copy link
Contributor

Looks good to me as well. Thanks!

@wilkinsona wilkinsona modified the milestones: 3.1.x, 3.1.0-M2 Mar 22, 2023
@wilkinsona wilkinsona self-assigned this Mar 23, 2023
wilkinsona pushed a commit that referenced this pull request Mar 23, 2023
This commit auto-configures the new pagination and sorting support for
Spring for GraphQL, if Spring Data is available.
The `GraphQlAutoConfiguration` now contributes a `CursorStrategy` bean
that is used to set up the pagination and sorting data fetching
infrastructure.

This commit also configures by default a
`ConnectionTypeDefinitionConfigurer` that automatically detects
`*Connection` types and contributes the relevant schema definitions
according to the Relay spec.

See gh-34677
@bclozel bclozel deleted the gh-34630 branch March 23, 2023 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GraphQL Boot starter support for pagination and sorting
4 participants