Add default_page_size to schema, field, and resolver #4081
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This implements #2999.
Essentially, this allows you to set
default_page_size
on the schema, fields, and resolvers.If no
first:
orlast:
values are specified, the default_page_size will be used to determine the size of a given page of results, and ifdefault_page_size
isn't set it'll fall back to the existing behavior withmax_page_size
. This should be backwards-compatible since the behavior is unchanged ifdefault_page_size
isn't set anywhere.I added basic documentation and specs, and I've tested this manually with my Rails app to make sure the main use-cases all work as-expected there. I'm not sure what other specs should be written for this, if any?
cc: @rmosolgo since you asked for a ping in that issue.