apollographql / apollo-studio-community

🎡  GraphQL developer portal featuring an IDE (Apollo Explorer), auto-documentation, metrics reporting, and more. This repo is for issues, feature requests, and preview docs. 📬
https://studio.apollographql.com
248 stars 29 forks source link

Map construction changes when you upload more than one file #263

Open lvalladares opened 10 months ago

lvalladares commented 10 months ago

Context

When you upload only one file, the "map" attribute sent in the multipart request look like this: map: {"0":["variables.contractor.driversLicense.licenseFile.file"]}

But when you try to upload more than one file, the map changes and look like this

map: {"0":["0.variables.contractor.driversLicense.licenseFile.file"],"1":["1.variables.contractor.signedContract.file"]} 0: (binary)

(notice the number before the "variables" part) which doesnt follow the spec.

If I remove the number before the "variables" string and send a cURL the server handles the upload properly

What type of feedback is this?

coeing commented 2 months ago

I can confirm this behavior and this makes it impossible to upload multiple files. Is there any reason behind this implementation or is it just a bug? 🙂

P.S.: Nonetheless, the possibility to upload a file via the Sandbox is awesome 🚀 It helps testing an API a lot.