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
This commit is contained in:
Douglas Muraoka
2019-12-28 02:13:07 -03:00
committed by Diamond Lewis
parent 558ce665a6
commit d7236ba8ef

View File

@@ -119,6 +119,8 @@ const findObjects = async (
) {
if (limit || limit === 0) {
options.limit = limit;
} else {
options.limit = 100;
}
if (options.limit !== 0) {
if (order) {