We are trying to implement Relay node query with Apollo federation. Since Apollo is not aware of Relay, we have to implement the node query in some service (Node Resolution Service)
interface Node {
id: ID!
}
type Query {
node(id: ID!): Node!
}
The trouble is that the Node resolution service is not aware of any of the implementation types as they are defined in other service subgraphs.
The Apollo Gateway sends the following request to the node resolution service
{node(id:"dHlwZUZyb21BU2VydmljZTox"){__typename ...on TypeFromAnotherService{id __typename}}}
The query validation fails as the service does not know anything about TypeFromAnotherService
. We are able to implement the node query as we have the type encoded in the ID, but we do not know how to fix the validation.
- We can generate the schema dynamically based on the federated schema. This seems to be used here but feels cumbersome
- Switch-off the validation and trust Apollo GW validation. We do not like it and it seems that it is not possible in Netflix DGS which we use on backend.
Any ideas how to make Relay node query work with the federation?