Federation and graphql-upload

I’m migrating a GraphQL monolith into separate subgraphs using Apollo Federation alpha 2.

Some of my subgraphs use the graphql-upload npm module to support mutations that require upload of binary content, implemented as per the instructions here.

I’ve checked by accessing those subgraphs individually that my Upload-based mutations still work in the subgraph.

I’ve extended my API gateway so that the server can use the graphqlUploadExpress() middleware in the same way as the subgraphs; it accepts the mutation multipart POST and forwards the request to the expected subgraph, but the request forwarded seems to have lost its “multipartness” and now has Content-Type set to application/json. This causes the subgraph to fail because it cant access the upload stream.

Am I missing something in my willSendRequest() implementation of RemoteGraphQLDataSource?

From taking a cursory step-through via debug it seems to me that there’s no way you could currently persuade RemoteGraphQLDataSource.sendRequest() to issue a multipart request to a subgraph - it seems to be fixed on constructing pure JSON payloads.

Is support for GraphQL Multipart Requests planned for Apollo Federation?

Issue 1385 raised to cover this.

I’ve seen apollo-federation-file-upload, but they’re using graphql-upload which if you read through this thread I’m not sure that this is a good solution going forward, especially if you’re using TypeScript. There is yet another package called apollo-federation-upload-minimal which uses a fork of graphql-upload that gets around these issues but that particular package doesn’t seem to have a lot of uptake so I’m very hesitant to roll that out in production.

Either way it seems like this kind of thing should be supported out of the box.