Skip to content

fix(graphql): define @interfaceObject and @composeDirective in federation prelude - #1255

Open
malept wants to merge 1 commit into
mainfrom
malept/dt-5639/fix/graphql-lint-federation-v2-3-directives
Open

malept wants to merge 1 commit into
mainfrom
malept/dt-5639/fix/graphql-lint-federation-v2-3-directives

Conversation

@malept

@malept malept commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

What this PR does / why we need it

Setting graphql.lint.federation: v2.3 fails on the generated shared.graphql with imports @interfaceObject, which devbase's federation v2.3 prelude does not define. That file imports both @interfaceObject and @composeDirective from the Apollo Federation spec, and the prelude defined neither.

Add both, using the signatures from the subgraph specification.

Jira ID

DT-5639

Notes for your reviewers

The prelude still rejects directives added in later spec versions, such as @authenticated, by name instead of guessing a signature.

Rejected review findings and intentional non-goals

These were raised in earlier reviews and deliberately left as they are. Do not raise them again unless the reasoning below no longer holds.

Rejected findings

  • None.

Intentional behavior

  • Directives from later spec versions (@authenticated, @requiresScopes, @policy, @context, @fromContext) are rejected by name on purpose. Their signatures have not been verified against this prelude.
  • Federation versions other than v2.3 are rejected by supportedFederationVersions.
  • Whether the name argument of @composeDirective refers to a defined directive is a composition rule, not something this linter checks.

…tion prelude

The stencil-generated shared.graphql imports both directives from the
Apollo Federation v2.3 subgraph spec. The federation prelude did not
define them, so setting graphql.lint.federation to v2.3 failed with
"imports @interfaceObject, which devbase's federation v2.3 prelude does
not define" in every repo that carries that file.

Add both directives, with the signatures from the Apollo Federation
subgraph specification.

Assisted-By: claude-sonnet 5.5 via opencode
@getoutreach-ci-1

Copy link
Copy Markdown
Contributor

Link to code coverage report (posted by coverbot 🤖)

@malept
malept marked this pull request as ready for review October 24, 2026 00:33
@malept
malept requested a review from a team as a code owner October 24, 2026 00:33

@Ned-el-ch Ned-el-ch 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.

lgtm

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