Our solution
The schema documents and enforces access requirements
Authorization directives embed access requirements directly in the GraphQL schema. The router evaluates them before execution — no code changes needed in resolvers.
From schema declaration to enforcement
Declare @authenticated on any field, object, interface, enum, or scalar that requires authentication.
Declare @requiresScopes with a nested array of scope requirements. Inner arrays are AND conditions; outer arrays are OR conditions.
Directives declared in a subgraph schema propagate automatically to the federated schema during composition.
At request time, the router evaluates directives before query execution — no resolver code runs for unauthorized fields.
Nullable fields return partial data with authorization errors. If a non-nullable field fails authorization, the entire response data returns null.
@requiresScopes error messages specify the required and actual scopes, giving clients actionable context. @authenticated errors state the reason: not authenticated.
JWT Authentication must be configured. Router 0.60.0+, Control Plane 0.58.0+.

