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

DRAFT: feat: Adds getAvoidOptionals to api side GraphQL codegen config when in TypeScript strict mode #9668

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dthyresson
Copy link
Contributor

See #9633 for the context.

When in strict mode, the desired behavior explain by @cjreimer is to avoid having optionals in the generated types.

This PR is one way we could solve his issue:

  • check if in strict mode
  • avoid optional in all cases ... including the resolvers with is "standard"

Questions remain"

  • better to have the config be customized in a project?
  • ... maybe, but would be difficult to merge in with there other config setting that are needed.
  • could some setting be added in tsconfig?

See https://redwoodjs.com/docs/typescript/strict-mode
See https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-operations#avoidoptionals

I think I need some context from @dac09 to determine if this is the correct way to resolve the issue.

@dthyresson dthyresson added topic/graphql release:chore This PR is a chore (means nothing for users) labels Dec 13, 2023
@dthyresson dthyresson added this to the next-release-patch milestone Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:chore This PR is a chore (means nothing for users) topic/graphql
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant