Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(GraphQL): Timeout when fetching huge collections #6304

Conversation

douglasmuraoka
Copy link
Contributor

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.

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.
@codecov
Copy link

codecov bot commented Dec 27, 2019

Codecov Report

Merging #6304 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6304      +/-   ##
==========================================
- Coverage   93.82%   93.81%   -0.01%     
==========================================
  Files         169      169              
  Lines       11571    11572       +1     
==========================================
  Hits        10856    10856              
- Misses        715      716       +1
Impacted Files Coverage Δ
src/GraphQL/helpers/objectsQueries.js 90.43% <100%> (+0.08%) ⬆️
src/RestWrite.js 93.62% <0%> (-0.17%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ef4248c...d7ed894. Read the comment docs.

@dplewis dplewis merged commit d7236ba into parse-community:master Dec 28, 2019
UnderratedDev pushed a commit to UnderratedDev/parse-server that referenced this pull request Mar 21, 2020
…#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
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