Middleware and an Upload scalar to add support for GraphQL multipart requests (file uploads via queries and mutations) to various Node.js GraphQL servers.
But when trying to upgrade to version 4, I can't upload files anymore. Without making any other changes apart from the upgrades, the data source server suddenly complained about an empty (or non-existent) Content-Type header. I tried adding it manually incl. a generated boundary (via FormData). But then the server started complaining about a missing query parameter. The transmitted query is exactly the same as before though.
I also tried adding fastify-multipart. But then graphql-upload's processRequest started throwing an error. Or rather, the underlying busboy package did: Error: Unexpected end of form at Multipart._final (node_modules/busboy/lib/types/multipart.js:588:17). Wasn't able to fix that either unfortunately.
Closing due to inactivity. Also figured that even downgrading graphql-upload there is still an issue. So, it's probably due to a change in one of the other deps.
Hi,
I use Apollo Server with Fastify and graphql-upload and am currently trying to upgrade to Apollo Server 4, Fastify 4 and graphql-upload 16.
When upgrading to the previous version 3 of Apollo and Fastify, using graphql-upload 12, I followed this example for uploads which worked right away: https://www.apollographql.com/docs/apollo-server/v3/data/file-uploads/#integrating-with-fastify.
But when trying to upgrade to version 4, I can't upload files anymore. Without making any other changes apart from the upgrades, the data source server suddenly complained about an empty (or non-existent)
Content-Type
header. I tried adding it manually incl. a generated boundary (viaFormData
). But then the server started complaining about a missing query parameter. The transmitted query is exactly the same as before though.I also tried adding fastify-multipart. But then graphql-upload's
processRequest
started throwing an error. Or rather, the underlying busboy package did:Error: Unexpected end of form at Multipart._final
(node_modules/busboy/lib/types/multipart.js:588:17). Wasn't able to fix that either unfortunately.