Skip to content

Add directive definition support to opt-in features RFC#2005

Merged
martinbonnin merged 1 commit into
graphql:mainfrom
glen-84:gai/optin-features-directive-support
Jun 18, 2026
Merged

Add directive definition support to opt-in features RFC#2005
martinbonnin merged 1 commit into
graphql:mainfrom
glen-84:gai/optin-features-directive-support

Conversation

@glen-84

@glen-84 glen-84 commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Updates the opt-in features RFC to support directives, now that directives on directive definitions are part of the draft spec.

  • Add DIRECTIVE_DEFINITION to the @requiresOptIn locations (and the docstring), with an example marking a custom directive opt-in.
  • List directive definitions alongside the other kinds (field, input field, argument, enum value) in the introspection prose, rather than adding a separate __Schema/__Directive block — matching how the section already handles arguments and enum values.
  • Align the includeDeprecated introspection argument with the current draft spec (Boolean! instead of Boolean).
  • Update the "marker directives" alternate solution: drop the now-resolved "requires a grammar change" con, and place the applied directive before the on clause to match the DirectiveDefinition grammar.
  • Fix an "include" → "included" typo in the introspection prose.

@martinbonnin martinbonnin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment thread rfcs/OptInFeatures.md

# includeRequiresOptIn is a list of features to include
fields(includeDeprecated: Boolean = false, includeRequiresOptIn: [String!]): [__Field!]
fields(includeDeprecated: Boolean! = false, includeRequiresOptIn: [String!]): [__Field!]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch 👍

Comment thread rfcs/OptInFeatures.md
Cons:

* more complex
* requires a grammar change

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@martinbonnin martinbonnin merged commit d237372 into graphql:main Jun 18, 2026
2 checks passed
@glen-84 glen-84 deleted the gai/optin-features-directive-support branch June 18, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants