Skip to content

all: Limit the 'skip' parameter in the same way as 'first'#1912

Merged
lutter merged 1 commit intomasterfrom
lutter/limit-skip
Sep 24, 2020
Merged

all: Limit the 'skip' parameter in the same way as 'first'#1912
lutter merged 1 commit intomasterfrom
lutter/limit-skip

Conversation

@lutter
Copy link
Collaborator

@lutter lutter commented Sep 23, 2020

This change adds the ability to enforce a global limit on the skip parameter in queries, in the same way that we limit first. This is prompted by the hosted service where we see queries with absurdly high skip values (10000 and more) Since GRAPH_GRAPHQL_MAX_SKIP defaults to u32::MAX this change will not do anything for now, though we should absolutely limit skip to something like 2000. Apps should only page through collections with first/skip to display them to humans, where 2000 items is more than any human will ever want to look at.

If an app needs to download an entire collection, it should not do that with first/skip as that will perform very badly for larger collections. Instead, it should follow the approach described here In addition, we should give apps a way to poll for updates to a collection they downloaded as described here

@lutter lutter requested review from Jannis, Zerim and leoyvens September 23, 2020 23:40
@lutter lutter merged commit 93addc1 into master Sep 24, 2020
@lutter lutter deleted the lutter/limit-skip branch September 24, 2020 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants