Relax @composeDirective validation when definitions are absent in some subgraphs. (#3422)
Previously, if some set of spec directives were being composed into the supergraph schema via @composeDirective, then subgraphs with the latest version of that spec would each have to declare all of those spec directive definitions. Not following this rule would often result in composition emitting a DIRECTIVE_COMPOSITION_ERROR error. This restriction has now been relaxed, and a definition needs to only be in at least one of those subgraphs with the latest version of that spec.
As an example, the following @composeDirective usage could previously fail, but is now valid.
# subgraph A — composes and defines @foo and @bar
extend schema
# ...
@link(url: "https://myorg.dev/myspec/v1.0", import: ["@foo", "@bar"])
@composeDirective(name: "@foo")
@composeDirective(name: "@bar")
# ...
directive @foo on FIELD
directive @bar on FIELD
# subgraph B — composes and defines only @foo
extend schema
# ...
@link(url: "https://myorg.dev/myspec/v1.0", import: ["@foo"])
@composeDirective(name: "@foo")
# ...
directive @foo on FIELD
21cf465d4c687daeed71635422718c3c7b7d2d0e, 5b36fc6b5a494aa6983e0339713dc45a0bd031e3, a20279a0184d9dfbc01a806d849dc8ae22497298]:
Fetched April 30, 2026