How can I upload files through graphql mutation using multipart/form-data instead of Base64

Our graphql API supports file upload through Content-Type: multipart/form-data. I've been spending hours trying to make Retool's graphql interface work with it, but had little success. Is it even possible through Retool?

I see that it supports uploading through Base64, but our API doesn't support it.

@harfangk I'm assuming you've already tried adding the Content-Type as a header in your request?

Yes, the header was there.

Hey harfangk! Would you mind sending us a screenshot of the request? I'm not 100% sure that we can make this work, but happy to help troubleshoot.

I'm also interested in retool but it doesn't seem to support the GitHub - jaydenseric/graphql-multipart-request-spec: A spec for GraphQL multipart form requests (file uploads).

While multipart requests are not currently supported with our GraphQL resource type, you may be able to use the REST API resource type (since GraphQL queries are just specifically formed POST requests) to get this functionality, using something like this (note that the body is set to "Form Data"):

1 Like

Hi, just to follow up on this is there any plan to support multipart requests with the GraphQL resource type?

Adding an additional resource specifically for this is problematic, particularly as our request requires authentication (is there any way to share authentication methods across multiple resources?)

Hey lawrence-pollen, I don't believe that adding multipart requests to the GraphQL resource is on our immediate roadmap at this time. There is also no built in way to share authentication between resources. I'll make sure that these are both added in as feature requests if they are not already there, thanks for checking in!

Hello there,

I would love to see that too, being able to upload file to graphql APIs is a must.