Skip to content
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

make maxResultsSize and defaultResultSize optional #609

Closed
oldwolf opened this issue Oct 19, 2020 · 5 comments
Closed

make maxResultsSize and defaultResultSize optional #609

oldwolf opened this issue Oct 19, 2020 · 5 comments
Labels
investigate question Further information is requested

Comments

@oldwolf
Copy link

oldwolf commented Oct 19, 2020

Thanks for your awesome package. Sometimes I have to set a large number to maxResultsSize & defaultResultSize for some models, like countries or currencies, to query all the data, this works but maybe there's better way to deal with?

Also there is inconsistent naming for maxResultSize, below is quoted from documentation

Default Paging#
By default all results will be limited to 10 records, with a max of 50 records returned.

To override the default you can override the following options:

read.defaultResultSize - The default number of results to return.
read.maxResultSize - The maximum number of results an end user can specify to return.
In this example we specify the defaultResultSize to 5 and maxResultsSize to 20.

@doug-martin
Copy link
Owner

@oldwolf in this case would it be better to turn paging off for those models? https://doug-martin.github.io/nestjs-query/docs/graphql/paging#disabling-paging

@oldwolf
Copy link
Author

oldwolf commented Oct 19, 2020

Yeah, i had same consideration before, but sometimes we need paging for listing page, while for dropdown selection or CSV export we want to disable paging, is there a way to kill two birds with one stone?

@doug-martin
Copy link
Owner

@oldwolf there isn't a way to make a relation act in different ways based on the use case. You could add the same relation twice one version for paging the other where the paging is turned off, but that could be confusing.

What is your suggestion on how to address this issue?

@doug-martin doug-martin added investigate question Further information is requested labels Oct 28, 2020
@oldwolf
Copy link
Author

oldwolf commented Oct 30, 2020

i would suggest remain the default result size & max result size, while adding an option to override them, like noLimitSize: true

@doug-martin
Copy link
Owner

doug-martin commented Mar 17, 2021

Added the ability to set -1 on maxResultSize to disable limiting of page sizes in @nestjs-query/[email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigate question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants