strawberry-FastAPI: Sending multiple parameters via curl?

83 views Asked by At

I have a small service that uses FastAPI-Strawberry that accepts some files:

import typing
import strawberry
from strawberry.file_uploads import Upload

@strawberry.type
class Mutation:
    @strawberry.mutation
    async def read_file(self, file: Upload, project: str) -> str:
        [do some processing]
        return "Done!"

Before I added in the second parameter to represent the project name, I tested the above with this CURL invocation:

curl localhost:8000/graphql \
  -F operations='{ "query": "mutation($file: Upload!){ readFile(file: $file) }", "variables": { "file": null } }' \
  -F map='{ "file": ["variables.file"] }' \
  -F [email protected]

How do I add in the second parameter to represent the project title? I tried adding in "project" wherever "file" was, but that didn't work.

0

There are 0 answers