Skip to content

Fix: cannot remove objects by setting to null #549

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

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

Conversation

AlexStansfield
Copy link
Contributor

@AlexStansfield AlexStansfield commented Feb 21, 2025

I'm not sure how this hasn't affected us before, but today we found that we were unable to remove an object with schema field from an item by setting it to null (as works with scalar fields). Instead it throws an error.

I found two places that caused an issue:

  1. collectNested: tries to collect the properties of the object but throws an error as it's null so has no properties
  2. convertNulls: skips the field if it has a schema, so never removes it

I've made this PR to resolve the issue. On my testing it seems to work fine, the unit tests also all pass.

However I'm not sure if this change might have some hidden impact I'm not aware of.

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