Customizable query complexity in harden-plugin
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.
Source: vendurehq/vendure