Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Banana Cake Pop the awesome Monaco based GraphQL IDE.
When passing a single role param into the Authorize extension it selects a policy instead, but adding a 2nd string param will then select the role variation. This can lead to some confusing overload usage.
I think the optional param on the policy should be removed or params remove from the role variation so that its clear which overload is selected.
Is there an existing issue for this?
Describe the bug
When passing a single
role
param into theAuthorize
extension it selects a policy instead, but adding a 2nd string param will then select the role variation. This can lead to some confusing overload usage.I think the optional param on the policy should be removed or
params
remove from the role variation so that its clear which overload is selected.Steps to reproduce
Due to
params string[] roles
andstring policy
having a optional param, .NET matches the incorrect signature (unless you pass more than one param in).My suggestion is to remove the
optional
param or removeparams
off the role variation.Relevant log output
No response
Additional Context?
No response
Product
Hot Chocolate
Version
12.9.0