As per my previous post, looking migrate a reasonably complex schema (examples below are extremely simplified) to federation. I’m coming unstuck where it seems a subgraph server is not completing the full resolver chain for a type. Any pointers to where I can start looking at would be great, I’ve not been able to determine the root cause.
Game subgraph
interface Game {
id: ID!
status: String!
sport: String!
}
type BasketballGame implements Game @key(fields: "id") {
id: ID!
display_status: String!
status: String!
sport: String!
}
Feed subgraph
interface Consumable {
id: ID!
type: String!
}
extend type BasketballGame implements Consumable @key(fields: "id") {
id: ID! @external
type: String!
}
extend type Query {
feed(user_id: ID!): [Consumable!]!
}
The query response returns the Consumable
array, and the __resolveType
resolver runs correctly, and where appropriate the gateway server sends { __typename: 'BasketballGame', id: 'some_game_id'}
to the __resolveReference
resolver on the BasketballGame
type in the Game subgraph (we may have other subgraphs with other types implementing Consumable
). The display_status
field has its own resolver, which takes some source data and generates the appropriate String response. This resolver is never executed. As that field is non-nullable, the Game subgraphs server throws errors to that effect. Strangely, the resolver for the status
field, which exists on the Game interface, does run.