# Send parameters and file for graphql

**URL:** <https://community.postman.com/t/send-parameters-and-file-for-graphql/12876>\
**Category:** Help Hub\
**Tags:** file, graphql, parameters\
**Created:** [May 26, 2020, 3:00am UTC](https://community.postman.com/t/send-parameters-and-file-for-graphql/12876 "2020-05-26T03:00:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aurigadl](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/aurigadl/32/4538_2.png) [@aurigadl](https://community.postman.com/u/aurigadl)\
**Post date:** [May 26, 2020, 3:00am UTC](https://community.postman.com/t/send-parameters-and-file-for-graphql/12876/1 "2020-05-26T03:00:04Z")

</div>

In the project [https://lighthouse-php.com](https://lighthouse-php.com) they have an example of sending files with Curl. How can I represent the same in Postman?

````
```
curl localhost/graphql \
  -F operations='{ "query": "mutation ($file: Upload!) { upload(file: $file) }", "variables": { "file": null } }' \
  -F map='{ "0": ["variables.file"] }' \
  -F 0=@my_file.txt
```
````

---

<div class="post-metadata">

**Author:** ![vdespa](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/vdespa/32/2770_2.png) [@vdespa](https://community.postman.com/u/vdespa)\
**Post date:** [May 29, 2020, 2:12am UTC](https://community.postman.com/t/send-parameters-and-file-for-graphql/12876/2 "2020-05-29T02:12:57Z")

</div>

I don’t think Postman currently supports file uploads with GraphQL.

---

<div class="post-metadata">

**Author:** ![Gooler](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/gooler/32/11125_2.png) [@Gooler](https://community.postman.com/u/Gooler)\
**Post date:** [February 10, 2022, 12:49pm UTC](https://community.postman.com/t/send-parameters-and-file-for-graphql/12876/3 "2022-02-10T12:49:33Z")

</div>

I ran into this issue using `graphene-file-upload==1.2.2` as the upload handler and found it extremely complex to prepare the correct payload as the request included additional parameters to the upload file, so I hope this helps:

 ![Screenshot_20220210_134308](https://us1.discourse-cdn.com/getpostman/original/2X/2/21f51da17dd8232021f875dbd66e9df8672ce8ee.png)

**Please note:** the `0` key field type is “File”, not “Text”, you’ll need to hover over the Key field right side for Postman to show the field type so you can change it.

This is the `curl` equivalent request for reference:

```auto
curl --location --request POST '<REDACTED>/graphql' \
--header 'Authorization: Bearer <REDACTED>' \
--form '0=@"/home/user/Downloads/Five.pdf"' \
--form 'map="{\"0\": [\"variables.data.attachments\"]}"' \
--form 'operations="{
    \"query\": \"mutation AddPOAttachments($data: AddProductAttachmentsInput!) { add_product_attachments(data: $data) { attachments { id url purpose file_info { name type size_in_bytes} __typename }__ typename }}\",
    \"variables\":
    {
        \"data\":
        {
            \"sku\": \"123456sku\",
            \"attachments\": null,
            \"purpose\": \"Test\"
        }
    }
}"'

```

---

<div class="post-metadata">

**Author:** ![allestaire.acasio](https://avatars.discourse-cdn.com/v4/letter/a/5f9b8f/32.png) [@allestaire.acasio](https://community.postman.com/u/allestaire.acasio)\
**Post date:** [November 10, 2022, 7:44am UTC](https://community.postman.com/t/send-parameters-and-file-for-graphql/12876/4 "2022-11-10T07:44:59Z")

</div>

What about sending array of files  
do you have any examples or documentation?

Found answer here:

> **[GitHub - jaydenseric/graphql-multipart-request-spec: A spec for GraphQL...](https://github.com/jaydenseric/graphql-multipart-request-spec)**
>
> A spec for GraphQL multipart form requests (file uploads). - GitHub - jaydenseric/graphql-multipart-request-spec: A spec for GraphQL multipart form requests (file uploads).
