@key, Apollo Federation v2 provides several directives that control field
ownership and sharing between subgraphs. All are available as helpers in
fastql.federation.
@external — fields owned by another subgraph
Mark a field as externally owned with external(). External fields must be declared
for @requires to reference them but are not resolved by this subgraph.
@requires — computed fields that depend on external data
requires(fields) declares that a field computation needs external field values to
be fetched first. The router forwards those fields in the entity representation.
@provides — eager-load related entity fields
provides(fields) tells the router that this subgraph can return the specified
fields of a related entity without an extra round-trip.
@shareable — allow a field to be resolved by multiple subgraphs
By default, a non-entity object type’s fields may only be resolved by one subgraph.
Apply shareable() to allow other subgraphs to also resolve those fields.
@override — migrate a field from another subgraph
override(from_subgraph) signals that this subgraph now owns a field that was
previously owned by another subgraph.
@inaccessible — hide from the public schema
inaccessible() excludes a type or field from the composed public API while still
making it available inside the federation for @requires / @provides.
@tag — annotate for contract filtering
tag(name) attaches a named tag used with Apollo Contracts to produce filtered
schema variants.
Previous: Entity resolution —
@key and reference resolvers.