Skip to content

Fix breaking change for @apollo/subgraph's buildSubgraphSchema - #4146

Merged
kamilmysliwiec merged 3 commits into
nestjs:masterfrom
paemuri:master
Sep 22, 2026
Merged

kamilmysliwiec merged 3 commits into
nestjs:masterfrom
paemuri:master

Conversation

@paemuri

@paemuri paemuri commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

This fixes @apollo/subgraph's breaking change described in the issue below. This patch enables applications that use @nestjs/graphql to also bump their @apollo/subgraph dependencies to v2.15 (at least for the apps that explicitly set federation version to 2).

Issue Number: #4145

What is the new behavior?

--

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

--

@paemuri paemuri changed the title Bump @apollo/subgraph and fix breaking change Fix breaking change for @apollo/subgraph's buildSubgraphSchema Sep 21, 2026
@paemuri

paemuri commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor Author

I initially tried to include the version bump (same as #4115) here, but it seems v2.15 have more breaking changes, outside of the scope of this issue/PR, so I reverted it and kept only the code changes for buildSubgraphSchema.

kamilmysliwiec and others added 2 commits September 22, 2026 09:15
- inline the Federation 1 directive definitions, as "@apollo/subgraph/dist/directives" no longer exists
- omit the federation types and schema definition that "printSubgraphSchema" now prints when generating definitions
- print the mercurius `_service` SDL without relying on "printSubgraphSchema", whose output changed, and without the stub definitions that "buildSubgraphSchema" now adds for extension-only types, which "@mercuriusjs/gateway" doesn't support
- bump @apollo/subgraph to 2.15.1

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
# Conflicts:
#	packages/graphql/package.json
@kamilmysliwiec
kamilmysliwiec merged commit 6170256 into nestjs:master Sep 22, 2026
1 check passed
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