Closed brad-decker closed 7 years ago
HTTP 413 Request Entity Too Large The server may reject your request in different places:
express-graphql
middleware. It has 100kb limit for body (source). And this problem was discussed here and was declined. I think, that this hard coded limit should be changeable. Developers may have different scenarios when a request is too big (bulk loading, raw base64 file).RRNL does not have the batch size option. It should be done somehow here https://github.com/nodkz/react-relay-network-layer/blob/master/src/relay/queriesBatch.js PR welcome. Sorry, I have no free time to do it myself 😔
If so many problems: on server-side, on client with batching (413) and without batching (too many requests). Anyway 315 times client, network and server generates/transmits/parses quite huge queries - too much wasted work.
I think better to use one of this solutions:
@nodkz Thanks for such a detailed response and all the solutions you've suggested. I think i might take a stab at doing the batch size but until then i'll implement the primeCache call you've suggested. Really appreciate it. 👍
Description of problem
Our application has a search bar that allows a user to search for items on our site. On click the search bar, relay grabs all data for the items that is searchable. When they select an item they are routed to a page that shows all items but the item that they clicked is focused (modal).
The problem is that because we are requesting more data on these items on this page, relay issues a node query for the missing data for each item (315 node queries). relay-network-layer correctly batches these together into one request but i get a 'payload too large' error (413).
Is there a way to specify a batch size so that i can avoid this issue?