-
Notifications
You must be signed in to change notification settings - Fork 26
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
Converting regular attributes from 'undefined' to 'null' #202
Conversation
28b5c9b
to
54e5f92
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoa!
@@ -44,7 +44,7 @@ export default DS.JSONSerializer.extend(DS.EmbeddedRecordsMixin, { | |||
payloadKey = this.keyForAttribute(key); | |||
} | |||
|
|||
json[payloadKey] = value; | |||
json[payloadKey] = typeof value !== 'undefined' ? value : null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a better way to check for 'undefined' values?
I wonder if we should use the attribute's PS: Stopping to think about it, that's probably what EmberData is already doing. If it gets |
Serializer is sending
undefined
in the graphql payload, which gets converted to"undefined"
in the backendThis change should default to
null
whenundefined
is present