Skip to content

Commit d7236ba

Browse files
douglasmuraokadplewis
authored andcommitted
fix(GraphQL): Timeout when fetching huge collections (#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
1 parent 558ce66 commit d7236ba

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/GraphQL/helpers/objectsQueries.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ const findObjects = async (
119119
) {
120120
if (limit || limit === 0) {
121121
options.limit = limit;
122+
} else {
123+
options.limit = 100;
122124
}
123125
if (options.limit !== 0) {
124126
if (order) {

0 commit comments

Comments
 (0)