Question: Error: request entity too large in graphql services of node

Question

Error: request entity too large in graphql services of node

Answers 1
Added at 2017-01-05 14:01
Tags
Question

I am working on node based graphql project, trying to send base64 formate image to server.

I am using bodyparser module and configured it as bellow.

app.use(bodyparser.text({type: 'application/graphql'}));

app.use(bodyparser.json({limit: '50mb'}));
app.use(bodyparser.urlencoded({limit: '50mb', extended: true}));

I am able to send base64 images by direct node services but when it come to graphql services, it is throwing error as "Error: request entity too large".

Please help me to overcome.

Answers
nr: #1 dodano: 2017-01-06 00:01

Are you using the graphql-express npm package?

If so then the issue is likely this line: https://github.com/graphql/express-graphql/blob/master/src/parseBody.js#L112

As you can see this sets a max size of 100kb for the request.

We ran into the same issue and fixed it by forking the repository and manually increased the max request size.

This might be a nice opportunity to contribute to the package though! It would be nice if the limit were configurable.

Source Show
◀ Wstecz