You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When a client start a subscription it sends a payload which can contain optional variables. Currently, serde default field attribute is being used.
It works if the key is not present or if it is an empty object ({}) but yield a serde error if it's null (invalid type: null, expected a map).
To Reproduce
Launch the actix_subscriptions example.
Launch a client (graphiql for example) and send a payload with "variables": null (with graphiql it should send null if no variable are specified)
Expected behavior
Treating the field as if it were absent.
Additional context
This kind of problem was already discussed on this issue.
Potential fix
One way to solve the issue is to use the default attribute and deserialize_with for example:
Describe the bug
When a client start a subscription it sends a payload which can contain optional variables. Currently, serde
default
field attribute is being used.It works if the key is not present or if it is an empty object (
{}
) but yield a serde error if it'snull
(invalid type: null, expected a map
).To Reproduce
actix_subscriptions
example."variables": null
(with graphiql it should sendnull
if no variable are specified)Expected behavior
Treating the field as if it were absent.
Additional context
This kind of problem was already discussed on this issue.
Potential fix
One way to solve the issue is to use the
default
attribute anddeserialize_with
for example:The text was updated successfully, but these errors were encountered: