#3857·vendure

Customizable query complexity in harden-plugin

Author: mzealeyCreated Oct 2, 2025Updated Sep 27, 2026
Labelstype: feature ✨👋 contributions welcomeP4: lowT3: Systemic

Is your feature request related to a problem? Please describe.

I would like to set it so that unauthenticated users have a lower ability on query complexity than logged in users as we can monitor logged in users in more detail, and they may be doing more complex queries (eg fetching order history).

Describe the solution you'd like

It already seems like the skip option can be hacked to do roughly this (eg I copy most of the calculation code into skip and then return to skip if it's ok otherwise return not to skip - but then the complexity calculation happens again).

It might be nice if it was possible to pass maxQueryComplexity: (context) => {...; return 100; } type function so it can do a dynamic calculation from context as to what it wishes the max query complexity to be for this request.