Entity References and the @key Directive
Master the heart of Apollo Federation: how subgraphs share entities using the @key directive and resolve references from other subgraphs in Spring Boot.
Entities Span Subgraphs
In federation, a single type like Product can be owned and extended by several subgraphs. The mechanism that lets them agree on the same object is the entity.
What Makes an Entity
An entity is a type with a @key directive. The key names the field(s) that uniquely identify an instance across subgraphs, like a primary key in a database.
type Product @key(fields: "id") {
id: ID!
name: String!
}All lessons in this course
- Introduction to Apollo Federation
- Building Federated Subgraphs
- Gateway Setup and Management
- Entity References and the @key Directive