Tag: file-upload
-
Should I use REST or GraphQL for file upload?
0 I have a GraphQL API, but I have doubts about whether to file upload in a graphql mutation or do it in a REST endpoint, I know that it can be done in both ways. I have read that for file uploading the ideal is to have a REST endpoint instead of a mutation.…
-
How to stream file upload using python gql client for GraphQL
0 I am using python gql client to upload files using GraphQL request as below: https://gql.readthedocs.io/en/latest/usage/file_upload.html I am using asynchronous transport transport = AIOHTTPTransport(url=’YOUR_URL’) async with Client(transport=transport) as client: query = gql(”’ mutation singleUpload($file: Upload!) { singleUpload(file: $file) { id } } ”’) async def file_sender(file_name): async with aiofiles.open(file_name, ‘rb’) as f: chunk = await…