Skip to content

Uploading file via graphql #3220

Discussion options

You must be logged in to vote

Found the solution.

POST {{GRAPHQL_EP}}
Authorization: Bearer {{API_KEY}}
Content-Type: multipart/form-data
[Options]
very-verbose: true

[MultipartFormData]
operations: {"query": "mutation Upload($doc: Upload!, $projectId: ID!) { Upload(input: {doc: $doc, projectId: $projectId}) { errors } }", "variables": { "doc": null,  "projectId": "{{projectId}}"}}
map: { "0": ["variables.doc"] }
0: file,basic.json;type=application/json

HTTP 200
[Asserts]
jsonpath "$.data.upload.errors" isEmpty

Just in case anyone is interested.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@riteshnoronha
Comment options

@riteshnoronha
Comment options

@jcamiel
Comment options

@riteshnoronha
Comment options

Answer selected by jcamiel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants