Our function checks whether each item in the cart belongs to specific collections.
Some of our larger customers have a high number of collections, and we need to check all of them using inCollections.
With 30 items and 60 collections, we’re running into the input size limit.
This happens because the input contains 30 × 60 = 1800 blocks in the following format:
This format consumes a lot of input space, causing us to hit the input size limit.
Please note: it’s not the instruction limit but the input size limit that is being exceeded.
Would it be possible to modify the return format of inCollections so that it returns only a list of collectionIds an item belongs to, instead of a list of objects containing both collectionId and isMember fields?
Or is there another way to achieve the same result without exceeding the input size limit?
@bkspace GraphQL aliases help a little, but as you said, they don’t fully resolve the issue.
We’re still running into the InputSizeLimitExceededError, even with just 5 collections and 250 lines in cart. At this scale, the input limit increases to 160 KB, but the inCollections sections end up consuming all of it.
Right, yea, I think the real fix is that the function input limits should scale based on input variables, and function output limits should also scale based on cart lines! Hopefully we get something like that in future