You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apollo Federation v2.3 introduced new @interfaceObject directive that allows users to extend entity functionality through inheritance, i.e. given subgraph A
interfaceProduct {
id: ID!title: String
}
# Book entity with keytypeBookimplementsProduct@key(fields: "id") {
id: ID!title: Stringpages: Int
}
# Movie entity with keytypeMovieimplementsProduct@key(fields: "id") {
id: ID!title: Stringduration: Int
}
We can generically extend the Product interface in other subgraphs by treating it as local object type with @interfaceObject directive. This new directive informs composition logic that it is actually an entity interface. This allows us to add new functionality in subgraph B without knowing any existing implementation details (i.e. without knowing anything about Book and Movie types).
Apollo Federation v2.3 introduced new
@interfaceObject
directive that allows users to extend entity functionality through inheritance, i.e. given subgraph AWe can generically extend the Product interface in other subgraphs by treating it as local object type with
@interfaceObject
directive. This new directive informs composition logic that it is actually an entity interface. This allows us to add new functionality in subgraph B without knowing any existing implementation details (i.e. without knowing anything about Book and Movie types).Additional resources:
New directive functionality can be tested using Apollo Federation Subgraph Compatibility NPX script (and Github Action). Example integration project is already provided in the subgraph compatibility testing repository.
The text was updated successfully, but these errors were encountered: