Extending an entity with type from other subgraph

Hello!

We are trying to extend an entity with a field coming from a different subgraph but the docs are not clear on this topic, specifically this example Introduction to Apollo Federation - Apollo GraphQL Docs

type User {
  id: ID!
  name: String
}
# Products subgraph
type Product {
  id: ID!
  name: String
  price: String
}

type User {
  id: ID!
  purchases: [Product]
}
# Reviews subgraph
type Review {
  id: ID!
  body: String
  author: User
  product: Product
}

type User {
  id: ID!
  reviews: [Review]
}

type Product {
  id: ID!
  reviews: [Review]
}

The docs say :

… each subgraph defines the types and fields that it is capable of (and should be responsible for) populating from its back-end data store.

However, if we follow that logic, the Review type should be extended with the Product type in the product subgraph, and with the User type in the User subgraph. Why is this not the case? Am I misunderstanding that sentence?

Thanks for your help

1 Like