-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
chore: update default GraphQL query limit values #4297
chore: update default GraphQL query limit values #4297
Conversation
// Enforce a `first: 50` limit if no user-supplied limit | ||
const limit = first || last || 50; | ||
// Enforce a `first: 20` limit if no user-supplied limit | ||
const limit = first || last || 20; |
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.
@kieckhafer Can you add const DEFAULT_LIMIT = 20;
at the top of the file and use that const here? We'll eventually put this in ENV but that's at least a little less magic for now.
@@ -7,13 +7,13 @@ beforeEach(() => { | |||
}); | |||
|
|||
test("with neither first nor last limits to first 50", async () => { |
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.
50
in the test name needs to change, too
@aldeed updated |
Resolves #4278
Impact: minor
Type: chore
Issue
The query limits are not optimized on our GraphQL queries
Solution
Change default first value (when neither first nor last are provided by the client) to 20, to have a default that minimizes DB and server load
Change the max first and last values to 200
Breaking changes
none.
Testing
Test on at least one query that has > 205 items. For example, import > 205 tags or catalog items.