Skip to content

fix 373 #375

New issue

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

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

Already on GitHub? # to your account

Merged
merged 5 commits into from
May 27, 2023
Merged

fix 373 #375

merged 5 commits into from
May 27, 2023

Conversation

Code-Hex
Copy link
Owner

fixed #373

For those who have been using this plugin, the following adjustments will be required with this PR.

Before

    config:
      # You can put the config for typescript plugin here
      # see: https://www.graphql-code-generator.com/plugins/typescript
      strictScalars: true
      # You can also write the config for this plugin together
      schema: yup # or zod

After

    config:
      # You can put the config for typescript plugin here
      # see: https://www.graphql-code-generator.com/plugins/typescript
      strictScalars: true
      # Overrides built-in ID scalar to both input and output types as string.
      # see: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript#scalars
      scalars:
        ID: string
      # You can also write the config for this plugin together
      schema: yup # or zod

By doing this, the built-in type ID will use the string type for both input and output, just as it did before.

In this plugin, if a union such as string | number is specified in the scalar, it will generate a validation schema equivalent to validating any type.

@Code-Hex Code-Hex merged commit 8d2b58a into main May 27, 2023
@Code-Hex Code-Hex deleted the fix/373 branch May 27, 2023 05:44
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@graphql-codegen/typescript v4 breaks package
1 participant