Replies: 1 comment
|
Your server side is fine. Both errors come from you setting the Fastest way to prove the server works, plain curl: curl localhost:8000/graphql \
-F operations='{"query":"mutation($animal: AnimalInput!, $file: Upload){ addAnimal(animal:$animal, file:$file){ id } }","variables":{"animal":{},"file":null}}' \
-F map='{"file":["variables.file"]}' \
-F file=@image.png
|
Uh oh!
There was an error while loading. Please reload this page.
I'm working on a mini-project to learn GraphQL, using GraphQL, Strawberry, and FastAPI. I'm trying to upload an image using a mutation, but I'm getting the following error:
{ "detail": "Missing boundary in multipart." }I searched for solutions, and ChatGPT suggested replacing the
Content-Typeheader with:However, when I try that, I get another error:
I'm using Altair as my GraphQL client because GraphiQL does not support file uploads.


Here is my
main.py:Here is my
graphql/mutation.py:I would really appreciate any help in understanding why the multipart upload isn't working. Any insights or fixes would be greatly appreciated!
All reactions