Use cases

This page is intended as a complement to the subgraph directives reference. We will If you want to read about the use cases for Federation in general, the overview is a better starting point.

Whenever you want to add fields to a type that exists in another subgraph, the answer is defining an entity with the @key directive.

The @override directive lets you define an existing field in another subgraph and redirect part of all the traffic from the overriden subgraph for that field all at once, or in a progressive manner. Read the directive documentation for more details.

The @authenticated and @requiresScopes directives allow you to restrict access to parts of your API based on the authentication state (JWT presence and scopes).

The @inaccessible directive lets you hide parts of your subgraphs completely.

If you have a concrete use case that you want to address with Federation, please talk to us on Discord.