-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
fix: Update GraphQL to return correct HTTP response code for file size limit upload errors #8082
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: Update GraphQL to return correct HTTP response code for file size limit upload errors #8082
Conversation
Thanks for opening this pull request!
|
Hi @ardatan, parse-server still use npm lockfile v1. So to install the project use |
@Moumouls Sure I will try :) |
@ardatan if a PR is in the works and not ready for review yet you can change its status to "draft"; I've started the CI |
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## alpha #8082 +/- ##
==========================================
- Coverage 94.18% 87.27% -6.91%
==========================================
Files 182 182
Lines 13712 13712
==========================================
- Hits 12914 11967 -947
- Misses 798 1745 +947 ☔ View full report in Codecov by Sentry. |
7a03ef6
to
b4ea255
Compare
Could you run it again @mtrezza ? |
Do you want to test anything specific in this CI that you cannot test locally by running |
b4ea255
to
e44efad
Compare
We released a new version now, I updated the PR and ran tests locally it passes. |
59dc218
to
051b7e6
Compare
@mtrezza There was an issue with Node 12 support. So I updated the PR again. |
Restarted CI |
Hi @ardatan thanks, i think we have merge conflicts here, related to the package.lock. Could you rebase your PR on alpha and then push again (or fix package.lock conflicts) then we should be okay 🚀 failing CI on node 17 is related to a flacky test on apple auth game center |
I've resolved the conflicts, waiting for CI to pass |
Not sure how to handle this change of which is essentially a 3rd party-managed API. This is a clear example of why #7979 is so important to move GraphQL into an adapter, out of the core of Parse Server. On the other hand if the file size limit is an undocumented GraphQL feature so far (or "experimental"), there may not even be a formal issue merging this as a "fix". As @n1ru4l said: "From our perspective, the file upload limit was undocumented and treated as unstable." Suggested changelog entry for this PR:
@n1ru4l please correct me if the "is an undocumented feature" does not accurately describe it |
What is the state of this PR? |
I will reformat the title to use the proper commit message syntax. |
@mtrezza closing this since we are on apollo now |
New Pull Request Checklist
Issue Description
Previously GraphQL Yoga was returning 500 but in the latest version it returns 400 which also not 100% correct.
It should be 413 which indicates that user sends a request over the specified limit per HTTP spec.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/413
graphql-hive/graphql-yoga#1270
With the PR above on GraphQL Yoga repo, the behavior is fixed per spec. But Parse Server tests need to be updated since it was expecting the wrong status code (500) which indicates a misleading internal server error that isn't related to the user.
Related issue: #8043 (comment)
Approach
TODOs before merging