Add query limits for array results
See original GitHub issueWhen doing a query such as:
query {
allPosts(first: 10){
id
}
}
All is ok 👍
But what happens when someone does a query like:
query {
allPosts(first: 10000000){
id
}
}
We need to have a way to set limits on the total results, perhaps like:
keystone.createList('Post', {
fields: {},
limits: {
maxResults: 100
}
});
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:14 (14 by maintainers)
Top Results From Across the Web
Limit query result of array field - node.js - Stack Overflow
I'm using mongoose and I need to limit the results of the users field in this example. Is it possible to do that?...
Read more >Limit the items returned from array - MongoDB
The syntax to restrict the number of elements returned from an array field using $slice in the projection ( "tokens": { $slice: 25...
Read more >Quotas and limits | BigQuery - Google Cloud
This document lists the quotas and limits that apply to BigQuery. A quota restricts how much of a particular shared Google Cloud resource...
Read more >Query limits - Azure Data Explorer | Microsoft Learn
This article describes Query limits in Azure Data Explorer.
Read more >Limit the Number of Items Returned from a GROQ Query
When working with large datasets, or when you simply want the first couple of results, it's essential to understand how to slice an...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Update: most of the features in the report have been added. The two that are still missing are
The query limits haven’t been integrated with the (relatively) new multi-schema system. Maybe we don’t need the function-based limits if we have schema-aware limits.
I’m not doing any work on this at the moment.
To stop people launching DoS attacks against a KS5 instance, and to also catch the case where the developer accidentally does a query such as:
(ie; with no
first
arg).Good points! We could accept a function like we already do for access control: