0PricingLogin
GraphQL APIs with Spring Boot · Lesson

Building Federated Subgraphs

Develop individual Spring Boot services as federated subgraphs, defining their schema and entity relationships.

Intro to Federated Subgraphs

In GraphQL Federation, a supergraph is composed of multiple independent GraphQL services, called subgraphs.

Each subgraph is a self-contained GraphQL API that owns a specific part of your domain model. Think of it as a microservice for your data.

The Apollo Gateway then combines these subgraphs into one unified API, making it easy for clients to query data across different services.

Understanding Federated Entities

Entities are the core concept for connecting subgraphs. An entity represents a type that can be referenced and extended across different services.

For example, a User entity might be defined in an "Auth" subgraph but extended by a "Product" subgraph to add user-specific reviews.

Entities are marked in the schema using the @key directive, which specifies how to uniquely identify an instance of that type.

All lessons in this course

  1. Introduction to Apollo Federation
  2. Building Federated Subgraphs
  3. Gateway Setup and Management
  4. Entity References and the @key Directive
← Back to GraphQL APIs with Spring Boot