Closed tupikoff closed 5 years ago
Because we need to support batching:
https://github.com/jaydenseric/graphql-multipart-request-spec#batching
Multiple operations with seperate sets of variables (that could have the same names) can be batched in one multipart request.
Also, if variables are in multipart form fields separate to the operation, because all the variables need to be collected one after the other, it becomes impossible to run the resolvers and while the files are still streaming up like in the async case:
I recommend that graphql-go-upload support this spec, that way they will be compatible with all the other implementations in the GraphQL ecosystem.
Why the spec doesn't propose to use variables along with the files upload? Here https://github.com/eko/graphql-go-upload it was implemented and it seems quite reasonable.