-
Notifications
You must be signed in to change notification settings - Fork 362
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
Null value is not handled in ObjectField #775
Comments
@SicParv1sMagna can you share a code example, please? |
I guess that's my mistake, objectfield doesn't have defaultValue props or something like that, besides default value for each element of object, isn't it? If this statement correct, I will close this issue, because I add defaultValue to objectField in my components scheme parser |
I could be persuaded that is a bug. The object field should probably be able to handle cases where the object is not defined. |
I can give full example only tomorrow, but I decided to use defaultValue like this:
this is example, which was written by memory, i guess that it could be incorrect |
I am seeing the same error, I am fetching data form Drupal via GraphQL and some fields are defined as nullable I added a helper function call to at
Once workaround it's applied it works as expected Agree with @chrisvxd and seems like a bug and |
This is actually a much more basic issue with the field implementation, and reproducible without objects. Even this basic case will trigger it. Interestingly, Puck does handle cases where the type is const config = {
components: {
Example: {
fields: {
title: { type: "text" },
},
// ...
defaultValue: {
title: null
}
},
},
}; Will roll out a fix now. |
Addressed. Available in both 0.17.4 and 0.18.0 canaries. 0.17.4 will be released ASAP. 0.18.0 next week. |
I have a deeply nested component with some nullable values by default. When I make that values null this error occurres, which I guess is a bug.
The text was updated successfully, but these errors were encountered: