You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Node.js version: v18.20.4 OS version: macOS Monterey 12.7.5
Description
The following error occurs when attempting to make a POST request to the /graphql endpoint using Supertest:
Error: cannotPOST/graphql(500)atResponse.toError(/src/node_modules/superagent/src/node/response.js:110:17)atResponse._setStatusProperties(/src/node_modules/superagent/src/response-base.js:107:48)atnewResponse(/src/node_modules/superagent/src/node/response.js:41:8)atTest._emitResponse(/src/node_modules/superagent/src/node/index.js:953:20)atIncomingMessage.<anonymous>(/src/node_modules/superagent/src/node/index.js:1166:38)atIncomingMessage.emit(node:events:525:35)atIncomingMessage.emit(node:domain:489:12)atendReadableNT(node:internal/streams/readable:1358:12)atprocessTicksAndRejections(node:internal/process/task_queues:83:21){status: 500,text: 'POST body missing. Did you forget use body-parser middleware?',method: 'POST',path: '/graphql'}
Actual Behavior
A 500 error is returned with the message:
POST body missing. Did you forget use body-parser middleware?
FYI: The API is working fine with appolo graphql client and postman.
Expected Behavior
The mutation should execute successfully with the attached file being processed by the /graphql endpoint.
Steps to Reproduce
The error can be reproduced using the following test code:
The issue seems related to missing or misconfigured middleware for processing multipart/form-data requests, such as body-parser or an equivalent package.
Ensure that the GraphQL server is configured to support file uploads and the appropriate middleware is applied before handling requests.
Request for Prioritization
This issue impacts the ability to test and upload files via the GraphQL API. A prompt resolution would be appreciated.
The text was updated successfully, but these errors were encountered:
Bug Report
Node.js version: v18.20.4
OS version: macOS Monterey 12.7.5
Description
The following error occurs when attempting to make a
POST
request to the/graphql
endpoint using Supertest:Actual Behavior
A
500
error is returned with the message:FYI: The API is working fine with appolo graphql client and postman.
Expected Behavior
The mutation should execute successfully with the attached file being processed by the
/graphql
endpoint.Steps to Reproduce
The error can be reproduced using the following test code:
Notes for Maintainers
multipart/form-data
requests, such asbody-parser
or an equivalent package.Request for Prioritization
This issue impacts the ability to test and upload files via the GraphQL API. A prompt resolution would be appreciated.
The text was updated successfully, but these errors were encountered: