Federation scalars are special scalar types used by Apollo Federation for distributed GraphQL schema composition. These scalars are primarily used internally by the federation runtime and are not typically used directly in client queries.
Available Federation Scalars
join__FieldSet
A string representation of a selection set used to specify fields for federation key directives.
Type: String
Usage: Used in @key directives to define entity keys across services.
# In Inventory Service
type InventoryItem @key(fields: "id") {
id: ID!
sku: String!
name: String!
stock: Stock
}
# In Picking Service
extend type InventoryItem @key(fields: "id") {
id: ID! @external
pickingOrders: [PickingOrderItem!]!
}
query {
inventoryItem(id: "item_123") {
# From Inventory Service
id
sku
name
stock {
available
reserved
}
# From Picking Service (federated)
pickingOrders {
id
quantity
pickingOrder {
referenceId
status
}
}
}
}