When I check the function output, there are 250 cart line items. Look like these function outputs are the bot activities. Even if I reduce/minimize my input.graphql in the function, the input must exceed 160 kB. Also, bots can submit a larger cart than 250 line items.
I can’t validate the input because the error happens before my js. Rust can only improve the instruction count limit. What’s the possible solution here?
Can you post your input query and an example function input?
Carts above 200 will automatically get a larger max input size. However if you are querying fields with a large amount of data on each product, you might still hit limits.
I think the problem is that the scaling of the input size is not directly related to the size of your input query or input variables. IMO, if a query fits into the 30 point limit, the input size should scale to any valid cart size.
One tip I can share is to use GQL aliases to limit the input size, for example, let’s say you use CollectionMembership, for each collection you check, you’ll get an object on each cart line that looks like so:
@bkspace Yes, the input.query total cost is around 21. But bots submit 250 cart line items. Therefore I find the cost limit not useful, may be it’s useful for compiling and building the js code into wasm.
And thanks for your tips for GQL aliases. I find the same suggestion with my ai agent. I’ll try it and see how it goes!