-
Notifications
You must be signed in to change notification settings - Fork 342
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
File upload does not work with gateway 1.0.5 #7701
Comments
I noticed graphql-mesh / yoga uses the File scalar to handle uploads as Strawberry uses "Upload". Could it be the issue here ? |
I created a repro here : https://github.com/MaximeDetne/mesh-strawberry |
Thanks for reporting @MaximeDetne! I've done some debugging and have discovered that your python server does not support chunked transfers (which is what is sent by Node because the FormData length is not known). You can reproduce the issue by appending Here's a curl snippet: curl localhost:8000 \
-H 'Transfer-Encoding: chunked' \
-F operations='{ "query": "mutation ($file: Upload!) { uploadFile(file: $file) { id } }", "variables": { "file": null } }' \
-F map='{ "0": ["variables.file"] }' \
-F [email protected] |
Thank you @enisdenjo ! Do you know if there is a workaround on the graphql-mesh side ? Can I force node not to use chunked transfers or can I provide the FormData length ? |
Sadly I cant think of a workouround that's simple enough. The thing with native FormData (which we use) is that it cannot accurately calculate the size when sending the data over the wire - so we cannot "just" calculate it and add a I am not familiar with Python, but I am quite sure this can be fixed there instead. |
I use GraphQL Mesh and hive-gateway (v1.0.5) to federate graphql apis based on strawberry+django.
I have a mutation with type Upload!, I'm able to upload a file directly on the strawberry API but not through hive-gateway.
On hive gateway I have (long after the sub api responded) : ERROR RangeError: Invalid string length
And on the sub API : code 400, message Bad request syntax (when sending thought hive-gateway)
I'm sending the exact same request with Altair Graphql client, it works when querying directly the sub api.
Environment:
"@graphql-mesh/compose-cli": "^1.0.2",
"@graphql-mesh/cross-helpers": "^0.4.6",
"graphql": "^16.9.0"
The text was updated successfully, but these errors were encountered: