Skip to content

Commit

Permalink
fix(GraphQL): Timeout when fetching huge collections (parse-community…
Browse files Browse the repository at this point in the history
…#6304)

* fix(GraphQL): Timeout when fetching huge collections

Currently, when not specifying a `limit` to the GraphQL find-like query, it tries to fetch the entire collection of objects from a class. However, if the class contains a huge set of objects, it is never resolved and results in timeout.

In order to solve this kind of problem, `parse-server` allows us to define a `maxLimit` parameter when initialized, which limits the maximum number of objects fetched per query; but it is not properly considered when the `limit` is undefined.

* fix: Keep same behavior as REST fetch
  • Loading branch information
douglasmuraoka authored and dplewis committed Dec 28, 2019
1 parent 2e32add commit 2f23288
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/GraphQL/helpers/objectsQueries.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ const findObjects = async (
) {
if (limit || limit === 0) {
options.limit = limit;
} else {
options.limit = 100;
}
if (options.limit !== 0) {
if (order) {
Expand Down

0 comments on commit 2f23288

Please sign in to comment.