RFC 3 / Accepted

Add support for directives on directive definitions

Opened on
Merged on

At a glance

Project
GraphQL Spec
Identifier
#1206
Stage
RFC 3 / Accepted
Champion
@BoD
Updated
2026-09-03
Latest activity
Added to WG agenda on
Source

Pull request description

Adds the ability to apply directives to directive definitions and to deprecate directives, with this syntax:

directive @onDirective on DIRECTIVE_DEFINITION

directive @foo @onDirective on OBJECT

directive @baz @deprecated(reason: "...") on OBJECT

extend directive @quux @deprecated(reason: "...")

With @IvanGoncharov's blessing, this PR is a continuation and updated version of #907 which I think can be closed. (There's also prior art in #567).

Motivation

Allow applying directive-exclusive features (e.g. @specifyBy, @deprecated) on directives.

For instance, on Apollo Kotlin we'd like to deprecate some client side directives.

Timeline

September 2026

June 2026

  • Pull request merged on by leebyron
  • Advanced to RFC 3 on by leebyron
  • Discussed in GraphQL WG

    The GraphQL specification team held a meeting to discuss two main agenda items: directives on directives and the upcoming GraphQL JS v17 release. Benoit presented the directives on directives feature, which is currently at RFC2 stage and waiting for more approvals, with a minor discussion about whether to include the deprecated argument in the introspection field. The team agreed to keep the argument consistent with existing implementations rather than introducing a new pattern. Yaacov led the discussion on the GraphQL JS v17 update, announcing the planned release date of June 15th after years of development work by the team. The new version includes breaking changes, cleaning up the codebase, and introduces incremental delivery features under an experimental flag. The team discussed the need to create a highlight reel of new features and announced upgrade guides for users still on older versions. Matt raised a question about creating a GAPS (Gaps and Ambiguities) working group to document known specification gaps and provide guidance to implementers on best practices.

    Zoom summary · GraphQL WG · 2026-06-04

    The meeting began with Lee noting that Benjie's agenda items were moved to the next meeting due to his absence. Lee introduced the topic of directives on directives, which Benoit was assigned to discuss. The group was reminded that there are two months until the next spec release freeze, encouraging participants to focus on finalizing late-stage items before the next meeting.

    Zoom summary · GraphQL WG · 2026-06-04

    Directives PR Discussion and Approval

    The team discussed a PR for directives on directives which is currently at RFC2 stage. Benoit presented the proposal and addressed a question raised by Benjie about whether to include the deprecated argument on the directives introspection field. The team debated consistency with existing implementations and decided to keep the argument as proposed. They also discussed the ability to extend directives with new directives, though there was some uncertainty about adding new arguments to existing directives. The team agreed to advance the proposal to accepted status and Lee merged it into the draft spec.

    Zoom summary · GraphQL WG · 2026-06-04

May 2026

  • Marked as Ready for Next Stage on by benjie
  • Discussed in GraphQL WG

    The May edition of the GraphQL Specification Working Group meeting covered several key topics including one-of-inhabitability, prohibiting root mutation and subscription types from implementing interfaces, and the potential transfer of projects like GraphQL PHP into the GraphQL organization. The group discussed the GraphQL over HTTP specification, with Martin presenting a proposal to move legacy protocol details to an appendix while maintaining compatibility. Benoit provided an update on the Directives on Directives proposal, which has been implemented in GraphQLJS and is ready for RFC3. Pascal raised questions about schema namespaces and their potential benefits for LLM interactions and schema composition. Mark introduced GAPS (GraphQLEcology Additional Specifications), a new home for community-written specifications that don't fit within the main GraphQL specification, and discussed the governance model and workflow for submitting and managing GAPS proposals.

    Zoom summary · GraphQL WG · 2026-05-07
    Next Steps

    Benoit: Continue to request reviews and approvals on the Directives on Directives spec PR before RFC3 merge.

    Zoom summary · GraphQL WG · 2026-05-07

    The GraphQL Specification Working Group meeting began with introductions and a review of the agenda, which included topics such as one-off inhabitability, prohibiting root mutation and subscription types from implementing interfaces, transferring projects like GraphQL PHP into the GraphQL organization, project adoption guidelines, GraphQL over HTTP specification, and Directives on Directives proposal. Pascal announced that the OpenTelemetry Semantic Conventions pull request he posted is ready for review and approval. The group agreed to create an issue in the main workgroup repository to discuss the pull request further and potentially merge it into the semantic conventions report. The meeting also touched on the availability of grants for key initiatives and the importance of submitting grant applications when needed.

    Zoom summary · GraphQL WG · 2026-05-07

    The team discussed moving forward with the GraphQL over HTTP specification, focusing on addressing legacy support concerns. They agreed to make non-normative recommendations for handling legacy requests while implementing the new media type for most cases, which would minimize breaking changes for existing clients while enabling better observability through HTTP status codes. Benjie expressed some remaining concerns about potentially breaking error handling in some clients, but the group reached consensus to proceed with the proposal. Benoit provided an update on directives on directives, noting that the spec PR is in RFC2 and the GraphQL-JS implementation has been merged, with the next step being RFC3 acceptance.

    Zoom summary · GraphQL WG · 2026-05-07

    The working group discussed releasing spec versions, deciding to maintain a September cadence rather than releasing before the conference in May. They reviewed Benoit's proposal for RFC3, with Martin noting its implementation in Apollo Kotlin and NYC expressing interest despite not having implemented it yet. Yaacov provided a positive functional review, and Benjie concluded that while the proposal likely would be merged, it needs more reviews and editorial feedback before proceeding to RFC3.

    Zoom summary · GraphQL WG · 2026-05-07

April 2026

  • Advanced to RFC 2 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-02
    Next Steps

    Benjie: Update GraphQLJS pull request for directives on directives to make "include deprecated" argument non-nullable before merging

    Zoom summary · GraphQL WG · 2026-04-02
    Next Steps

    Lee/Benoit: Merge the GraphQLJS pull request for directives on directives after the "include deprecated" fix

    Zoom summary · GraphQL WG · 2026-04-02

    The team reviewed the agenda and discussed editorial updates for leaf fields. Martin presented a pull request that clarified the definition of leaf fields to include enums and added a definition block. Lee explained the SpecMD syntax used for defining terms. The team then moved on to discuss updates on directives, with Benoit set to present on that topic next.

    Zoom summary · GraphQL WG · 2026-04-02
    Directive Feature Migration Discussion

    The team discussed moving a directive-on-directive feature from RFC1 to RFC2. They agreed on the syntax approach and decided to make the includeDeprecated argument non-nullable before merging. The feature will be implemented with an experimental feature flag in GraphQL 16, with plans to forward-port to GraphQL 17 later. Lee offered to merge the changes directly after making the type adjustment, as the implementation appeared straightforward and safely gated behind a feature flag.

    Zoom summary · GraphQL WG · 2026-04-02

January 2026

  • Advanced to RFC 1 on by benjie
  • Discussed in GraphQL WG

    graphql/graphql-spec#1206 and graphql/graphql-js#4521

    Meeting notes · GraphQL WG · 2026-01-15

    Benoit: Collect feedback on the directives-on-directives PR and continue implementation/testing, especially in GraphQLJS and related tooling (with support from NYC for relay compiler/tooling).

    Zoom summary · GraphQL WG · 2026-01-15

    All: Review and comment on the directives-on-directives PR and related tooling PRs (including GraphQLJS, relay compiler, etc.).

    Zoom summary · GraphQL WG · 2026-01-15

    Benjie: Move the directives-on-directives PR to RFC1 status and monitor for consensus to move to RFC2.

    Zoom summary · GraphQL WG · 2026-01-15

    The meeting focused on several key topics related to GraphQL specifications and best practices. Martin and Michael discussed the potential for merging scalar efforts and agreed that a formal GraphQL namespace could be beneficial, though they emphasized the importance of allowing flexibility for community contributions. Lee suggested organizing the website by kind rather than contributor, and Benjie proposed a system where specs could link to each other to indicate equivalency or subsets, potentially allowing tooling to handle these relationships. Benoit presented a proposal for applying directives to directives, which would allow for deprecating directives, and the group agreed to move this to RFC1. Benjie also introduced the concept of a "golden path" initiative to make best practices the default experience for new GraphQL users, emphasizing the need for collaboration across libraries, frameworks, and tooling to achieve this. The conversation ended with a brief discussion on the importance of providing concrete examples and documentation to support these best practices.

    Zoom summary · GraphQL WG · 2026-01-15

December 2025

November 2025

December 2021