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

feat(@nestjs/graphql): add support for skipNullProperties in PartialType #3276

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bloom-alex
Copy link

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?

Adding the same skipNullProperties as this PR https://github.com/nestjs/swagger/pull/2863/files added for the Swagger version of PartialType. Original feature coming from this Mapped-Type PR nestjs/mapped-types#1274

Issue Number: N/A

What is the new behavior?

PartialType can optionally return a class for which validations are ignored only for undefined properties, not null properties. This can be useful if you are creating a DTO for a mutation endpoint: there may be a certain field, say name, that should not be null, but which doesn't need to be included in updates.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

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.

1 participant