How to define operations map in POSTMAN for GraphQL file upload

Viewed 263

This is what my schema looks like:

extend type Mutation {
    createMutation(
      my_id: ID!
      my_data: input_data
    ): some_output


input input_data {
    some_key: ID!
    file : Upload!
}

This is how I am defining my operations in POSTMAN

{
  "query": "mutation CreateMutation($my_id: ID! , $my_data: [input_data]) { createMutation(my_id: $my_id, my_data : $my_data) {   some_key}}",
  "variables": {
    "my_id": "some-string-id",
    "my_data": [
      {
        "some_key": 123,
        "file" : null
      }
    ]
  }
}

under map I have : { "0" : ["variables.file"] }

I map 0: file_from_local.png
enter image description here

The server recieves file = null, what am I doing wrong? How can I replace this

1 Answers

Updating map to { "0" : ["variables.my_data.0.file"] } fixed it

Related