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
Describe the bug
When creating a custom directive that is used on input objects types, the middleware registered for said custom directive is never invoked.
To Reproduce
Define a custom directive.
publicclassOneFieldDirective:DirectiveType{protectedoverridevoidConfigure(IDirectiveTypeDescriptordescriptor){
descriptor.Name("oneField");
descriptor.Description("Indicates only one field is allowed.");
descriptor.Location(DirectiveLocation.InputObject);
descriptor.Use(next =>context =>{ Console.WriteLine("This is never executed");return next?.Invoke(context);});}}
Run the app and submit a query that uses the input object type.
Expected behavior
The middleware for the custom directive is invoked.
Desktop (please complete the following information):
OS: MacOS Catalina 10.15.2, Windows 10
Additional context
My team is currently trying to evaluate ways we could implement a query that allows locating a single record by multiple lookup types e.g. record id, or various other Ids that might tie to the specific record. One idea we are trying to explore was implementing something similar to the @oneField/@oneOf suggestion for handling input unions as a GraphQL standard. Since the directive approach is one that is theoretically feasible to implement now, or team tried this out in our GraphQL app but found that the middleware for the directive is never invoked.
If there is any guidance that can be provided for another workaround that can be implemented with the current Hot Chocolate versions in the meantime that would be greatly appreciated! Thank you so much for your time and reviewing the issue!
The text was updated successfully, but these errors were encountered:
A directive middleware is only added to a field middleware pipeline when the directive was annotated to the object definition, the field definition or the field.
Describe the bug
When creating a custom directive that is used on input objects types, the middleware registered for said custom directive is never invoked.
To Reproduce
Expected behavior
The middleware for the custom directive is invoked.
Desktop (please complete the following information):
Additional context
My team is currently trying to evaluate ways we could implement a query that allows locating a single record by multiple lookup types e.g. record id, or various other Ids that might tie to the specific record. One idea we are trying to explore was implementing something similar to the
@oneField
/@oneOf
suggestion for handling input unions as a GraphQL standard. Since the directive approach is one that is theoretically feasible to implement now, or team tried this out in our GraphQL app but found that the middleware for the directive is never invoked.If there is any guidance that can be provided for another workaround that can be implemented with the current Hot Chocolate versions in the meantime that would be greatly appreciated! Thank you so much for your time and reviewing the issue!
The text was updated successfully, but these errors were encountered: