Skip to content

Transform external composed sdl to public sdl - #8398

Open
jdolle wants to merge 1 commit into
mainfrom
transform-external-composed-sdl-to-public-sdl
Open

Transform external composed sdl to public sdl#8398
jdolle wants to merge 1 commit into
mainfrom
transform-external-composed-sdl-to-public-sdl

Conversation

@jdolle

@jdolle jdolle commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

Background

An issue was reported where suddenly a team's public SDL included federated directives

Description

I was able to identify the cause as this change: https://github.com/graphql-hive/console/pull/8319/changes#diff-f912a95c08d02dee17df2da852f56f215ec961506f1d50eb792971fc09cb5b5aL247

Because the composition library we use automatically make this calls, it was mistakenly assumed that the external composer would also call this. Since this composer is external by definition, I dont think it's safe to make that assumption.

Long term, we should remove this extra transform from all composition logic. Before doing this, we must ensure all existing systems are compatible or we have a plan to migrate.

For now, I've added back the transform based on an environment variable. This will transform the external supergraph SDL result to match the previous behavior.

Checklist

  • Testing

@jdolle
jdolle requested a review from n1ru4l August 22, 2026 01:23
@jdolle jdolle self-assigned this Aug 22, 2026
@theguild-bot

theguild-bot commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@graphql-hive/gateway-plugin-console-sdk 0.1.5-alpha-20260824191446-9fb0c4b4c2a526c5c6a49428d2c0a543c64e499d npm ↗︎ unpkg ↗︎
@graphql-hive/yoga 0.49.5-alpha-20260824191446-9fb0c4b4c2a526c5c6a49428d2c0a543c64e499d npm ↗︎ unpkg ↗︎
hive 11.12.1-alpha-20260824191446-9fb0c4b4c2a526c5c6a49428d2c0a543c64e499d npm ↗︎ unpkg ↗︎

@github-actions

github-actions Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

🐋 This PR was built and pushed to the following Docker images:

Targets: build

Platforms: linux/amd64

Image Tags: 11.12.1-alpha-9fb0c4b, 9fb0c4b, 9fb0c4b4c2a526c5c6a49428d2c0a543c64e499d

Comment thread packages/services/schema/__tests__/external.spec.ts Outdated
* This is done for us in the native composition library
* https://github.com/graphql-hive/federation-composition/blob/77d6b4ece2abacf94164beafb4e7f5961f726755/src/compose.ts#L228
*/
return print(transformSupergraphToPublicSchema(parse(sdl)));

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.

shouldn't we run transformSupergraphToPublicSchema on the supergraph instead of the sdl?

I also flagged this internally - this restores previous behaviour - which is to not take the public sdl as it is provided by the external composition. I am not sure if we should do that. 🤔 I would argue it is the responsibility of user that uses the external composition to return the proper public schema sdl

@n1ru4l n1ru4l Aug 24, 2026

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.

Is in the specific scenario the apollo composition returning an invalid public sdl schema that still contains supergraph specific SDL or is it a custom customer endpoint that is sending wrong stuff for the public sdl?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The later. This is a custom external composition implementation that isnt converting the public sdl into a an API Schema

@n1ru4l n1ru4l 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.

@jdolle
jdolle requested a review from n1ru4l August 24, 2026 18:09
@jdolle
jdolle force-pushed the transform-external-composed-sdl-to-public-sdl branch from 746052b to 9fb0c4b Compare August 24, 2026 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants