Skip to content

fix(graphql): keep nullable list items in PartialType - #4233

Merged
kamilmysliwiec merged 1 commit into
nestjs:masterfrom
thekhegay:fix/partial-type-nullable-items
Nov 11, 2026
Merged

kamilmysliwiec merged 1 commit into
nestjs:masterfrom
thekhegay:fix/partial-type-nullable-items

Conversation

@thekhegay

Copy link
Copy Markdown
Contributor

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?

PartialType sets nullable: true on every field, so list field declared with nullable: 'items' or 'itemsAndList' ends up as [String!] in generated input. Items lose nullabilty, Update input is stritcer than Create one

Issue Number: N/A

What is the new behavior?

Fields with 'items' or 'itemsAndList' get 'itemsAndList' in PartialType, so list becomes nullable and items stay nullable. Other fields still get true. Added spec for plain, true, 'items' and 'itemsAndList' list fields

Does this PR introduce a breaking change?

  • Yes
  • No

Update input only gets looser for these list fields, items can now be null like in Create input

Other information

@kamilmysliwiec
kamilmysliwiec merged commit d4a0f15 into nestjs:master Nov 11, 2026
1 check passed
@thekhegay
thekhegay deleted the fix/partial-type-nullable-items branch November 11, 2026 16:34
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.

2 participants