Add support for directives on directives
At a glance​
- Identifier: #907
- Stage: RFC1: Proposal
- Champion: @IvanGoncharov
- PR: Add support for directives on directives
Timeline​
- Added to 2022-01-06 WG agenda
- Mentioned in 2022-01-06 WG notes
- Spec PR created on 2021-12-02 by IvanGoncharov
- Commit pushed: Add support for directives on directives on 2021-12-02 by @IvanGoncharov
- Added to 2021-12-02 WG agenda
I suggest allowing to specify directives on directives with the following syntax:
directive @foo on DIRECTIVE_DEFINITION
directive @bar on FIELD @fooMotivation​
Allow applying directive-exclusive features (e.g.
@specifyBy
,@deprecate
) on directives.Validation​
We already have a rule in place that prevent cycles in directives
A directive definition must not contain the use of a directive that references itself indirectly by referencing a Type or Directive which transitively includes a reference to this directive.
https://spec.graphql.org/draft/#sel-HAHnBTDDABAB_F_kC
So validation is already in place and already paid "complexity cost".