Closed o-rumiantsev closed 3 years ago
It's a tricky situation; I've answered over here:
https://github.com/jaydenseric/graphql-upload/issues/227#issuecomment-742211820
It looks like version 3 of graphql-upload (apollo-upload-server) introduced v2 of the spec, which means that you will have to deal with a field name change and a change in field ordering. From the perspective of the spec, this is a breaking change. It was released only a couple months after the first version was published, so I suspect that a migration path was not an important criteria (and honestly this is the first case of this that I've seen in the many years I've been following this).
The only real solution here without updating the clients is to add a layer that detects and translates the spec v1 request into a v2 spec request. You mentioned you're using the JS libraries so this should be quite practical to do, but certainly isn't trivial:
graphql-upload
operations
you know you have a v2 spec request:
graphql-upload
to proceed as normalfiles
you know you have a v1 spec request:
files
part into a new memory bufferoperations
) send any contents from the initial buffer and begin streaming the contents of the operations
part to your replacement streamoperations
part is reached, immediately replay the contents of the files
buffer into the replacement streamgraphql-upload
to proceed as normalAgain, this is non-trivial and probably represents a solid couple days of work, but is certainly doable if the scale of your operation demands it. This is obviously out of scope for the project at this point, but best of luck!
Hi, I am upgrading old GraphQL dependencies on my project. For file uploads
apollo-upload-server@2.0.3
is used (I understand that now there is version11
:)). We have a lot of users using mobile client, so we have no ability to update all our clients. How should I deal withmap
property which is required now, but is not sent from most of the clients?I am using: Fastify - as a web framework Mercurius - as fastify gql plugin MercuriusUpload - as gql upload plugin