Operation directive is not called for location QUERY.
I have written an operation directive which should be available for use on QUERY, similar to this reduced example:
@strawberry.directive(locations=[DirectiveLocation.QUERY])
async def my_directive(value: Any):
"""
Adds contextual information to node like content language.
"""
print('called')
return value
schema = strawberry.Schema(
directives=[my_directive],
query=RootQuery,
)
When running a query like
query @myDirective {
someData {
id
}
}
the directive method isn't called at all. If running the directive on a field like someData
or id
however, the function gets called, event though FIELD is not in the list of locations. I tried defining a root value but this didn't make any difference.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too