1

In the code I am calling the GraphQL API with a request having the parameter fields as an array of 21 objects along with an image.

If fields has 15 objects, the GraphQL API request goes through fine. But, if it is more than that (15 objects), then the network request fails.

Below is the Cypress code wrote to fire the GraphQL call.

cy.intercept('/graphql', (req) => {
 aliasImageUpload(req, 'sendImage')});

 export const aliasImageUpload = (req, operationName) => {
   const { body } = req;
   if (body.byteLength) {
     req.alias = `gql${operationName}ImageUpload`          
   }
}

What can I do to make the GraphQL API request be successful if the fields parameter has more number of objects (>15)?

user521024
  • 521
  • 2
  • 7
  • 29
  • Tried to find the request limit in the Cypress package but was unable to find it, but in the Appollo client the request limit size is 100kb to increase it mostly body-parser is used, here I guess we can use fragment functionality of graphql and send two separate requests – Navitas28 May 23 '23 at 01:27

0 Answers0