At a glance
- Project
- GraphQL Spec
- Identifier
- #1208
- Stage
- RFC 1 / Proposal
- Champion
- @benjie
- Updated
- 2026-06-23
- Latest activity
- 5 commits pushed on
- Source
- Pull request
- Related RFCs
- #1163
Pull request description
(Extracted and reworked from the error behaviors PR (#1163) to stand alone, since it has broader utility and can progress faster alone.)
This PR introduces "service capabilities" - a mechanism for GraphQL services to advertise features and configuration that exist outside the type system - for example support for syntax features (executable descriptions, fragment arguments, document directives, etc), details of transport support (websocket endpoint, SSE endpoint, how to be notified of new schema versions), and other details that can enable automated client configuration.
Motivation
In addition to being a prerequisite of the error behaviors proposal, this is a desired feature for composite schemas and a key component of The GraphQL Golden Path Initiative (specifically enabling client auto-configuration).
The goal is that a user can point tooling at a GraphQL endpoint and much of the configuration can be implied based on the service's advertised capabilities - this massively reduces the amount of "out of band" communication required.
Example use cases:
- Does the service support fragment arguments, or must the client transpile them?
- Does it support customizing error propagation behavior?
- Are subscriptions available over WebSockets? If so, what endpoint and protocol?
- Does it support incremental delivery (
@defer/@stream)? Which version? - Does it support automated document persistence? Which protocol?
Why "capabilities" not "metadata"?
Capabilities inform automated tooling/client decisions and actions. Metadata is ancillary and often intended for human consumption. The name "capabilities" is intentional - it signals the purpose and discourages using this system as a dumping ground for arbitrary metadata. Every capability should be actionable by clients or tooling.
Design
Introspection via __service: __Service meta-field (similar to __schema: __Schema):
type __Service {
capabilities: [__Capability!]!
}
type __Capability {
identifier: String!
description: String
value: String
}
Support can be probed via: { __type(name: "__Service") { name } } - if no result, then the service does not support service capabilities.
SDL syntax
Slightly changed from previous proposals, here's the syntax I now propose:
service {
"Descriptions on operations and fragments are supported"
capability graphql.operationDescriptions
"WebSocket transport is supported via the given endpoint"
capability example.transport.ws("wss://api.example.com/graphql")
}
extend service {
capability com.example.customFeature
}
Notes on this choice:
- Capabilities without "values" should look neat
- Capabilities with values followed by capabilities without descriptions should not introduce easy syntax clashes (
service { capability foo.bar "Value" capability foo.baz }would apply"Value"as the description forfoo.bazrather than the value forfoo.bar) - The
extendsyntax feels very natural - Avoids double-nesting of curly braces
- Leaves space for additional
serviceproperties in future - Inserting other keywords between capabilities is acceptable, in the same way that inserting different directives between repeatable directives is acceptable
- A directive-based syntax could be used (
service @capability(identifier: "...", value: "...")), but theservicekeyword already introduces new syntax so it doesn't seem necessary to be constrained to using ugly directives when a neater and more palatable syntax is available; this also allows for descriptions for each capability.
Capability identifiers
A QualifiedName syntax (Name(.Name)+) inspired by reverse-domain notation encourages global uniqueness. The graphql. prefix is reserved for official GraphQL Foundation specifications (not just the main spec; e.g. graphql.http.* could be used by the GraphQL-over-HTTP spec).
Timeline
April 2026
- 5 commits pushed on
- @benjie committed "Capability identifier -> capability name"
- @benjie committed "Missed one"
- @benjie committed "Further expand on uniqueness"
- @benjie committed "Another identifier->name"
- @benjie committed "Add missing description for a service"
- Advanced to RFC 1 on by leebyron
- Discussed in GraphQL WG
The GraphQL Technical Specification Committee (TSC) meeting focused on reviewing several specification updates and proposals. The team discussed and approved a change to leaf field definitions in the specification, with Martin leading the discussion on formatting improvements. Benoit presented updates on directives on directives, which is currently at RFC1 stage, and the group agreed on the syntax approach despite some concerns about readability. Pascal provided an update on the OpenTelemetry working group, presenting a new specification for GraphQL semantic conventions that has been submitted for review. The team then extensively discussed the GraphQL over HTTP specification, with Benjie explaining the new 294 status code for partial success and the decision to move application/json media type details to an appendix before the first release. The conversation ended with Benjie presenting service capabilities as a new RFC1 item, discussing potential implementation approaches and future considerations for handling deprecation in the schema.
Zoom summary · GraphQL WG · 2026-04-02Next StepsBenjie: Create GraphQLJS implementation of Service Capabilities (separate from on-error handling)
Zoom summary · GraphQL WG · 2026-04-02The team discussed two main topics: GraphQL over HTTP specification and service capabilities. For GraphQL over HTTP, they agreed to make one final pass through the TSC for approval before moving to RFC3, with Martin suggesting a weekly meeting cadence in April to focus on completion. Benjie presented service capabilities as a new RFC1 item, which the team approved. The discussion included considerations about handling deprecation in the schema and potential future service capabilities, with Lee suggesting adding deprecation handling to the __schema field rather than __service.
Zoom summary · GraphQL WG · 2026-04-02
February 2026
- Advanced to RFC 0 on by benjie
January 2026
- Pull request created on by benjie
- 13 commits pushed on
- @benjie committed "Extract service capabilities"
- @benjie committed "Reserve example.* identifiers"
- @benjie committed "Replace default capabilities"
- @benjie committed "Update syntax, add examples"
- @benjie committed "Editorial"
- @benjie committed "Extend syntax"
- @benjie committed "Note that IANA reserved domains are also reserved"
- @benjie committed "Clearer"
- @benjie committed "Lee suggested to not use +"
- @benjie committed "Move Service stuff to bottom of lists"
- @benjie committed "More editorial"
- @benjie committed "Format"
- @benjie committed "Typo"
- Discussed in GraphQL WG
Service capabilities (10m, Benjie)
- Current status: RFC1 via original Error behaviors/service capabilities PR
- Aim: agree on syntax
All: Review and provide feedback on Benjie's service capabilities PR (syntax and implementation) before the next working group meeting.
Zoom summary · GraphQL WG · 2026-01-15All: Review and comment on the service capabilities PR, especially regarding syntax and implementation, before next working group meeting.
Zoom summary · GraphQL WG · 2026-01-15