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

Refactor GraphQL File Upload Implementation #2838

Closed
DimuthuMadushan opened this issue Apr 7, 2022 · 0 comments · Fixed by ballerina-platform/module-ballerina-graphql#680
Assignees
Labels
module/graphql Issues related to Ballerina GraphQL module Points/1.5 Team/PCM Protocol connector packages related issues Type/Improvement

Comments

@DimuthuMadushan
Copy link

Description:
When uploading a file using the ballerina GraphQL package, the multipart request should follow the GraphQL Multipart Form Request Specification. According to this, the map field values in multipart request, should be preceded by the word variables.
Ex:

curl http://sample.com \
    -F operations='{ "query": "mutation($file: Upload!) { fileUpload(file: $file) { link } }", "variables": { "file": null } }' \
    -F map='{ "0": ["variables.file"] }' \
    -F [email protected]

But the graphql package accept the following format:

curl http://sample.com \
    -F operations='{ "query": "mutation($file: Upload!) { fileUpload(file: $file) { link } }", "variables": { "file": null } }' \
    -F map='{ "0": ["file"] }' \
    -F [email protected]

here, -F map = {"0": [file]} should be -F map = {"0": [variables.file]}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/graphql Issues related to Ballerina GraphQL module Points/1.5 Team/PCM Protocol connector packages related issues Type/Improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant