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

Allow more enum configs in client-preset #10158

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jthoward64
Copy link

The client-preset package restricts the allowed configs to improve developer experience, however in monorepo environments it is important that some things work the same across the board. A big example of this is enums, notably having enums defined as const and being able to reuse any enums that are shared between client and server

🚨 IMPORTANT: Please do not create a Pull Request without creating an issue first.

Any change needs to be discussed before proceeding. Failure to do so may result in the rejection of the pull request.

Description

The client-preset package restricts the allowed configs to improve developer experience, however in monorepo environments it is important that some things work the same across the board. A big example of this is enums, notably having enums defined as const and being able to reuse any enums that are shared between client and server.

This PR does exactly that, allows passing enumsAsConst and enumValues to the underlying plugin.

Related # (issue)

#8993

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

Screenshots/Sandbox (if appropriate/relevant):

N/A

How Has This Been Tested?

Literally just add the config options and see the change, I have been using these fields in @ukdanceblue/monorepo for almost a year now without issue.

Test Environment:

  • OS: Windows or Linux
  • @graphql-codegen/...: client-preset
  • NodeJS: 18,20,22

Checklist:

  • I have followed the CONTRIBUTING doc and the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Further comments

N/A

The client-preset package restricts the allowed configs to improve developer experience, however in monorepo environments it is important that some things work the same across the board. A big example of this is enums, notably having enums defined `as const` and being able to reuse any enums that are shared between client and server
Copy link

changeset-bot bot commented Sep 30, 2024

🦋 Changeset detected

Latest commit: aec63c0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@graphql-codegen/client-preset Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Collaborator

@saihaj saihaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please create a minor changeset for this and include description for the changes so it can be part of the changelog

@saihaj saihaj added the waiting-for-answer Waiting for answer from author label Oct 7, 2024
@jthoward64
Copy link
Author

Done

@jthoward64 jthoward64 requested a review from saihaj November 3, 2024 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-for-answer Waiting for answer from author
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants