You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The exception is thrown due to the use of Activator.CreateInstance where AuthorizeDirective has no default constructor and no constructor arguments are provided to Activator.CreateInstance. This circumstance seems to be the result of choices made around the "implicit" arguments model which seem to imply (at least currently...assuming I understand correctly) that a directive must have a default constructor.
To Reproduce
Steps to reproduce the behavior:
Add the @authorize directive to a schema
Register the directive
Query the field or type which is protected by the directive
Note that an exception is thrown and processing continues as normal (the fact that processing continues as normal seems to be an issue as well, I would have expected that an error be returned for this too, separate bug?)
Expected behavior
When an exception is thrown in the GraphQL middleware pipeline, I would expect to see an error response noting this.
The use of the @authorize directive should not throw an exception in the GraphQL pipeline
Desktop (please complete the following information):
OS: Windows 10
Version:10.0.17134.0
Additional context
N/A
The text was updated successfully, but these errors were encountered:
Note that an exception is thrown and processing continues as normal (the fact that processing continues as normal seems to be an issue as well, I would have expected that an error be returned for this too, separate bug?)
Describe the bug
Due to the behavior of
Directive.ToObject
,AuthorizeDirectiveType
throws an exception inAuthorizeAsync
on this line:The exception is thrown due to the use of
Activator.CreateInstance
whereAuthorizeDirective
has no default constructor and no constructor arguments are provided toActivator.CreateInstance
. This circumstance seems to be the result of choices made around the "implicit" arguments model which seem to imply (at least currently...assuming I understand correctly) that a directive must have a default constructor.To Reproduce
Steps to reproduce the behavior:
@authorize
directive to a schemaExpected behavior
@authorize
directive should not throw an exception in the GraphQL pipelineDesktop (please complete the following information):
Additional context
N/A
The text was updated successfully, but these errors were encountered: