Skip to main content

GraphQL Federation Planner

v1.0.0

Subgraph composition planner — entity ownership, @key directives, shared types.

GraphQL Federation Config
# router.yaml (Apollo Router)

federation_version: =2.5.0

subgraphs:
  - name: users
    routing_url: http://users-service:4000/graphql
  - name: products
    routing_url: http://products-service:4000/graphql
  - name: orders
    routing_url: http://orders-service:4000/graphql
  - name: inventory
    routing_url: http://inventory-service:4000/graphql

# Subgraph schema example (users service)
# Use @key directive to define entity boundaries:

type User @key(fields: "id") {
  id: ID!
  email: String!
  name: String!
}

# In the products subgraph, reference User without owning it:
type Review {
  id: ID!
  product: Product!
  author: User @external  # resolved by users subgraph
}

# Start router:
# router --config router.yaml

# Supergraph schema check:
# rover supergraph compose --config supergraph.yaml