When querying an abstract type (interface or union type), it's useful to be able to filter on the __typename. However, we can't add a __typename field to the filter because the __ prefix is reserved by GraphQL for the spec's usage:
https://spec.graphql.org/October2021/#sec-Names.Reserved-Names
Any Name within a GraphQL type system must not start with two underscores "__" unless it is part of the introspection system as defined by this specification.
Given that, we punted on supporting filter: {__typename: {equalToAnyOf: [...]}} when we initially implemented support for interface/union types.
It's still a useful feature, though. We can add support by defining it as _typename:
filter: {_typename: {equalToAnyOf: [...]}}
When querying an abstract type (interface or union type), it's useful to be able to filter on the
__typename. However, we can't add a__typenamefield to the filter because the__prefix is reserved by GraphQL for the spec's usage:https://spec.graphql.org/October2021/#sec-Names.Reserved-Names
Given that, we punted on supporting
filter: {__typename: {equalToAnyOf: [...]}}when we initially implemented support for interface/union types.It's still a useful feature, though. We can add support by defining it as
_typename:filter: {_typename: {equalToAnyOf: [...]}}