API / Apollo Gateway Interview questions
What is schema composition in Apollo Federation?
Schema composition is the process of combining every subgraph's SDL into a single supergraph schema. The composer validates that types agree across subgraphs — for instance, that a field defined in two places has a matching type, or that a field intentionally shared across subgraphs is actually marked @shareable — and then produces routing metadata describing which subgraph owns which field.
Composition can run in a couple of different places: locally via the Rover CLI (rover supergraph compose) using a static supergraph config file, or centrally in GraphOS as part of managed federation whenever a subgraph schema is published.
If composition fails — say, two subgraphs define the same field with conflicting types — the supergraph simply isn't produced, and the previous working supergraph keeps serving traffic until the conflict is fixed.
More Related questions...