Skip to content

feat(packages/graphql): resolve field output type by name#3932

Open
NicolasGn wants to merge 1 commit intonestjs:masterfrom
NicolasGn:resolve-output-type-by-name
Open

feat(packages/graphql): resolve field output type by name#3932
NicolasGn wants to merge 1 commit intonestjs:masterfrom
NicolasGn:resolve-output-type-by-name

Conversation

@NicolasGn
Copy link
Copy Markdown
Contributor

@NicolasGn NicolasGn commented Apr 15, 2026

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?

In a code-first schema definition, we need to import the type of any object field.
This behavior can lead NodeJS module circular import issue because GraphQL philosophy allows (and even encourage in complex schemas) cyclic relations.

Here is tiny project illustrating the problem with a very simple 3 types schema, using a classical GraphQL pattern: https://github.com/NicolasGn/nestjs-graphql-circluar-dependency

What is the new behavior?

To break the circular import, we need to be able to reference a schema type by its name and not exclusively by a type reference.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@NicolasGn
Copy link
Copy Markdown
Contributor Author

NicolasGn commented Apr 15, 2026

I'm not sure of where I should write the test for this feature.

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.

1 participant