Skip to main content

Add support for directives on directives

At a glance

Timeline


I suggest allowing to specify directives on directives with the following syntax:

directive @foo on DIRECTIVE_DEFINITION
directive @bar on FIELD @foo

Motivation

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".