0

Facing issue with uploading an image using graphql. When I test the following query using postman I get an error (shown below).

Query:

{"query":"mutation($file: Upload) {sendImage(file: $file)
  }","variables":{"file":null}}

Error:

BadRequestError: Invalid JSON in the ‘operations’ multipart field (https://github.com/jaydenseric/graphql-multipart-request-spec).

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
vignesh K B
  • 124
  • 3
  • 10

1 Answers1

-1

By default, the results are sent as application/json payload but for file upload, you need to make a multipart request.

you can follow this link to make multipart request using postman.

Read more about file upload

Abhishek
  • 1,302
  • 10
  • 18