Skip to content

Comments

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

Merged
kamilmysliwiec merged 1 commit intonestjs:masterfrom
ssut:fix/build-schema-options-scalars-map
Jul 2, 2024
Merged

fix(graphql): ensure scalarsMap in buildSchemaOptions is respected#3219
kamilmysliwiec merged 1 commit intonestjs:masterfrom
ssut:fix/build-schema-options-scalars-map

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

2 participants