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 type graphql nullable types #4835

Closed
wants to merge 2 commits into from
Closed

Fix type graphql nullable types #4835

wants to merge 2 commits into from

Conversation

borremosch
Copy link
Contributor

@borremosch borremosch commented Sep 30, 2020

⚠️ This pull request includes the changes in #4833. Unfortunately there was no other way to do it, as #4833 includes a refactored way of setting TypeGraphQL decorator options

This merge requests is an improvement over #4181 and fixes #4663. In GraphQL arrays, there are several nullable types:

  • Items in the array may be null, ([String]!)
  • The array itself may be null, ([String!])
  • Both the array and items in the array may be null ([String])
  • Neither the array nor the items in it may be null ([String!]!])

So far, @graphql-codegen/typescript-type-graphql did not support either of the cases where the items in the array can be null. This led to uncompilable code, which #4181 attempted to fix. However, there were two problems with this merge request:

TypeGraphQL supports nullable list types through the options { nullable: 'items' }, and { nullable: 'itemsAndList' }, which this pull request will properly set on the field and input field decorators.

@changeset-bot
Copy link

changeset-bot bot commented Sep 30, 2020

🦋 Changeset detected

Latest commit: 6422810

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

This PR includes changesets to release 2 packages
Name Type
@graphql-codegen/typescript-type-graphql Patch

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

@borremosch
Copy link
Contributor Author

borremosch commented Oct 15, 2020

Branch has become unmergable. Will create a new pull request

@borremosch borremosch closed this Oct 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Maybe only refers to a type, but is being used as a value here (only arrays)
1 participant