Error: "Query has complexity of 31, which exceeds max complexity of 30"

You can’t have multiple queries for the same target in one Function.

Please take a look at this discussion, where other developers and I are asking Shopify to change how this limit works: Workarounds for the input query complexity limitation?