-
Notifications
You must be signed in to change notification settings - Fork 61
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
Support maximumLimit in pagination #515
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add a test for this scenario?
I could try and have a look, but doesn't seem like there's any tests for setting it via the main config at the moment (or for defaultLimit)? |
@GuySartorelli looking into this for @ec8or, how would I test I had found |
Probably the simplest way, without diving in too deep, would be to set up a new test schema folder, set up whatever schema you need in order to test a) without setting this and b) with setting this, and then write a test that executes a query on each of those scenarios. |
Ultimately though, if you can't get a test working with the time you have to look into this, then if you can give me a simple example of how to test it locally that would be okay for now. |
Thanks! I'm not sure if I'll have the time to build something new like that. I can include test schema data that I had in mind for this. The query I'd use for both scenarios: query {
readMyTypes(limit: 5) {
nodes {
field1
}
pageInfo {
totalCount
}
}
} For with the config schema: SilverStripe\GraphQL\Tests\Fake\DataObjectFake:
fields:
myField: true
operations:
read:
plugins:
paginateList:
maximumLimit: 3 and the query from above, which checks the size of For without the config schema: SilverStripe\GraphQL\Tests\Fake\DataObjectFake:
fields:
myField: true
operations:
read:
plugins:
paginateList: true and the query from above, which checks the size of |
At the moment, you can only change the maximum limit in the overall settings. This enables support for the maximumLimit setting per model.
I've changed the target branch to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this. Works exactly as advertised. Will merge when CI goes green.
At the moment, you can only change the maximum limit in the overall settings. This enables support for the maximumLimit setting per model.
Issues