Skip to content

Nestjs SDL Generation Doesn't Work with Federation #3722

@marc-wilson

Description

@marc-wilson

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

The NestJS documentation outlines steps for generating GraphQL schemas, but these steps do not work correctly with federation. The same issue exists when generating an SDL at runtime, with a known workaround mentioned here.

That pull request has been open for over 3 years, and several related issues have been locked without explanation or follow-up. It’s understandable that maintaining open-source software requires prioritization, but closing and locking issues without context or communication—especially when they affect core functionality that's advertised to work—leaves the community without a clear path forward.

At this point, either the bug needs to be fixed or officially addressed, or the documentation should be updated to clearly state that NestJS does not currently support federation for SDL generation. Without clarification, developers following the official documentation are led to believe this feature works as described when it does not.

Since this problem specifically impacts the build-time SDL generation tooling for federated subgraphs, I’m opening this issue specifically for that. Not, runtime generation where a workaround exists.

Before closing this issue and locking it from any comments form your user base, please provide some explanation as to

  • why this is blocked
  • when we can reasonably expect a fix (or if can't be fixed)

Minimum reproduction code

https://github.com/nestjs/nest/tree/master/sample/31-graphql-federation-code-first

Steps to reproduce

No response

Expected behavior

https://docs.nestjs.com/graphql/generating-sdl should result in a working and accurate schema. Or, NestJs should explicitly state that federation isn't supported.

NestJS version

11

Packages versions

"@apollo/server": "^4.12.2",
"@apollo/subgraph": "^2.11.2",
"@nestjs/apollo": "^13.1.0",
"@nestjs/graphql": "^13.1.0",

Node.js version

No response

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions