Hello,
I’m wondering if the @policy
directive supports interfaces. We are using @policy
directives with an external coprocessor and a team wanted to use the @policy
directive on a concrete type that implemented an interface. When querying we got an UNAUTHORIZED_FIELD_OR_TYPE
even though the policy should have evaluated to true.
Here is a naive example of what the schema / query that we’re using looks like:
interface A {
id
name
}
@policy(policies: [["ABC"]])
type B implements A {
id
name
}
type C implements A {
id
name
}
query {
getStuff {
... on B {
id
name
}
... on C {
id
name
}
}
}
The response that we get is
{
...
"errors": [
{
"message": "Unauthorized field or type",
"path": [
...
],
"extensions": {
"code": "UNAUTHORIZED_FIELD_OR_TYPE"
}
}
]
}