Skip to content

fix(composition): propagate directives from @interfaceObject fields to @external implementations#3456

Open
dariuszkuc wants to merge 3 commits into
mainfrom
dk/intfobject_external
Open

fix(composition): propagate directives from @interfaceObject fields to @external implementations#3456
dariuszkuc wants to merge 3 commits into
mainfrom
dk/intfobject_external

Conversation

@dariuszkuc

@dariuszkuc dariuszkuc commented Jul 17, 2026

Copy link
Copy Markdown
Member

When an implementation re-declares a field as @external (e.g. to reference it in @requires), the field's only resolvable definition lives on the abstracting @interfaceObject. Directives like @tag applied there were not being propagated to the implementation's copy in the supergraph.

During add_interface_object_fields, detect implementation fields where every @join__field is external: true and the field is provided by an @interfaceObject, then copy applicable directives onto the implementation field.

…@external implementations

When an implementation re-declares a field as `@external` (e.g. to reference it in `@requires`), the field's only resolvable definition lives on the abstracting `@interfaceObject`. Directives like `@tag` applied there were not being propagated to the implementation's copy in the supergraph.

During `add_interface_object_fields`, detect implementation fields where every `@join__field` is `external: true` and the field is provided by an `@interfaceObject`, then copy applicable directives onto the implementation field.

<!-- [FED-1074](https://apollographql.atlassian.net/browse/FED-1074) -->
@dariuszkuc
dariuszkuc requested a review from a team as a code owner July 17, 2026 16:03
@apollo-librarian

apollo-librarian Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

✅ Docs preview has no changes

The preview was not built because there were no changes.

Build ID: 7b4300f496f84c46e2de5572
Build Logs: View logs


✅ AI Style Review — No Changes Detected

No MDX files were changed in this pull request.

Review Log: View detailed log

This review is AI-generated. Please use common sense when accepting these suggestions, as they may not always be accurate or appropriate for your specific context.

@changeset-bot

changeset-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9decd0d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@apollo/composition Patch
@apollo/gateway Patch
@apollo/federation-internals Patch
@apollo/query-planner Patch
@apollo/query-graphs Patch
@apollo/subgraph Patch
apollo-federation-integration-testsuite Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

for (const destArg of dest.arguments()) {
const subgraphArgs = mapSources(withoutExternal, f => f?.argument(destArg.name));
this.mergeArgument(subgraphArgs, destArg);
if (someSources(withoutExternal, isDefined)) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We should only merge below IF we have non external sources. Without this guard we end up merging access control directives twice -> once during normal merge field logic and then again when propagating @interfaceObject field directives.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants