Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(graphql): ensure scalarsMap in buildSchemaOptions is respected #3219

Merged

Conversation

ssut
Copy link
Contributor

@ssut ssut commented Jun 19, 2024

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?

The scalarsMap in buildSchemaOptions was not used even though it was defined.

This PR also fixes issues like #3204 by correctly merging the scalarsMap, ensuring that duplicate ScalarsTypeMap entries are ignored by their type. e.g.

buildSchemaOptions: {
  numberScalarMode: 'integer',
  scalarsMap: [
    {
      type: Date,
      scalar: GraphQLDateTime,
    },
  ],
}

What is the new behavior?

This PR ensures that the scalarsMap in buildSchemaOptions is respected and correctly merged with the scalarsMap from ScalarsExplorerService.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

The scalarsMap in buildSchemaOptions was not used even though it's defined. This change ensures that the scalarsMap is correctly merged and respected in the buildSchemaOptions.
@kamilmysliwiec kamilmysliwiec merged commit 31171c3 into nestjs:master Jul 2, 2024
1 check passed
@kamilmysliwiec
Copy link
Member

lgtm

@kamilmysliwiec
Copy link
Member

Sounds like this PR might have introduced a regression #3244

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants