Open GauBen opened 2 months ago
That seems reasonable to me, I think modifying this line https://github.com/hayes/pothos/blob/3cebfed6f033ee92c2b3492a3fd6d3002906ab08/packages%2Fplugin-scope-auth%2Fsrc%2Ffield-builders.ts#L58
To do something like this would work
authScopes: options.authScopes ? { $all: [scopes, options.authScopes] } : scopes,
It's probably a little more complex, i think my example works if the new scopes are an object, but not if it's a function. Handling the function case should be pretty easy though by wrapping it to return the merged scopes
Hey, I noticed that while you can use both
withAuth
andauthScopes
on the same field, it does not actually combine declarations despite what type declarations lead to thinkhttps://github.com/hayes/pothos/blob/3cebfed6f033ee92c2b3492a3fd6d3002906ab08/packages/plugin-scope-auth/src/field-builders.ts#L58C7-L58C26
Example:
Instead, I'd like both
{ user: true }
andauthScopes(){}
to be merged