We are working on updating our Graph to Apollo v4. As we are running tests have noticed that a query which is aliasing __type()
returns no data ({}
). Is this expected behavior? The query returns data in our v3 configuration. If this should work perhaps we aren’t setting something up correctly.
Example
Returns as expected:
query getAllSessionLocationDestination {
__type (name:"SessionLocationDestination") {
name
enumValues {
name
description
}
}
}
Doesn’t return any data ("data": {}
):
query getAllSessionLocationDestination {
TargetLocationEnums:
__type (name:"SessionLocationDestination") {
name
enumValues {
name
description
}
}
}
The difference being the alias on __type
Upon further investigation the both the above queries work if run against the subgraph which contains that enum. It’s only through the gateway the above issue is seen.
Versions;
@apollo/gateway: 2.4.0
@apollo/server: 4.5.0
@apollo/subgraph: 2.4.0
@graphql: 16.6.0
Reproduce at codesandbox: https://codesandbox.io/p/sandbox/inspiring-rain-6biu2h
ReviewTypes: __type(name: "ReviewType") {
name
enumValues {
name
description
}
}
}```