jaydenseric / graphql-upload

Middleware and an Upload scalar to add support for GraphQL multipart requests (file uploads via queries and mutations) to various Node.js GraphQL servers.
https://npm.im/graphql-upload
MIT License
1.42k stars 131 forks source link

multipart fields #386

Closed appasaheb4 closed 1 month ago

appasaheb4 commented 1 month ago

Facing below issue: [Nest] 22115 - 05/24/2024, 5:13:37 PM ERROR [ExceptionsHandler] Misordered multipart fields; files should follow ‘map’ (https://github.com/jaydenseric/graphql-multipart-request-spec). BadRequestError: Misordered multipart fields; files should follow ‘map’ (https://github.com/jaydenseric/graphql-multipart-request-spec).

jaydenseric commented 1 month ago

The error message means the client is not sending the request correctly, as per the error message. This repo is for handling GraphQL multipart requests on the server side. Please investigate why your client is sending invalid requests and fix the problem there.

appasaheb4 commented 1 month ago

Hi @jaydenseric thanks for reply. Issue fixed. app.use( '/graphql', graphqlUploadExpress({ maxFileSize: 10000000, maxFiles: 10 }), ); app.use('/api', formData.parse());

appasaheb4 commented 1 month ago

I handle both grahql with rest api single instace image upload time facing issue I fixed. thx