How to enable GraphQL Yoga File Upload

Hello!

Based on how I understand it, graphql yoga, the graphql server that runs under redwood api server, is able to accept file uploads via the Graphql Multipart Request Spec.

However whenever I try it, get this fasitfy error:

{
  "statusCode": 415,
  "code": "FST_ERR_CTP_INVALID_MEDIA_TYPE",
  "error": "Unsupported Media Type",
  "message": "Unsupported Media Type: multipart/form-data"
}

I tried adding server.addContentTypeParser(‘multipart/form-data’, {}, (req, payload, done) => done(null)) as dictated by Graphql Yoga’s own docs, but I’m still getting the same error.

Any form of advise or direction would be truly appreciated.

Hey @jovancahiles, what kind of file are you trying to upload? The server is configured to accept multipart/form-data but not necessarily all file types out of the box.

Hey @dom , thanks for the quick reply.

I’m trying to upload a PDF file to be processed in the server.