Closed justinmakaila closed 4 years ago
Yes, the ordering of the fields is required by spec, for technical reasons:
So operations can be resolved while the files are still uploading, the fields are ordered — https://github.com/jaydenseric/graphql-multipart-request-spec#multipart-form-field-structure
The operations
field must be first, and the map
field must be second.
Implementations such as graphql-upload
rely on this order; it has tests ensuring misordered fields result in appropriate errors, e.g:
Why is there the requirement to order fields in the request? Trying to build something that would handle this in react native with mostly native code handling the requests to ensure execution and completion in the background, but when passing a dictionary of parameters over the bridge to the native code, it's getting ordered and added to the body alphabetically.
Just wanted to know if there were technical limitations/requirements to the field ordering before spending time trying to re-work my native implementation. Thanks!