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
with CreateItem.make(~item={ "id": None, name: "foo" })" request payload will be {item: { id: null, name: "foo"}}.
if None will be treated as undefined - JSON.stringify will drop keys from request payload. I guess this can be tricky since Js.Json.t is used and undefined is not a JSON of course. We can filter them out then?
The text was updated successfully, but these errors were encountered:
There is no way to replace Js.Json.null with undefined. According to glennsl/bs-json#50 (comment) solution would be to omit null value in field_array somewhere here
This sounds similar to #26, where the conclusion would be to use option(option(t)) for optional input variables. I'm thinking now that Js.Nullable would be a better solution, though. Either way, this is a breaking change.
Hi @mhallin,
I have a question about forcing
None
values inside mutation variables asnull
. Is this correct?graphql_ppx/src/output_bucklescript_encoder.ml
Line 59 in 96ca3cb
I think it will be more correct to treat
None
asundefined
, andSome(Js.Nullable.null)
as null inside make function.with
CreateItem.make(~item={ "id": None, name: "foo" })"
request payload will be{item: { id: null, name: "foo"}}
.if
None
will be treated asundefined
-JSON.stringify
will drop keys from request payload. I guess this can be tricky sinceJs.Json.t
is used and undefined is not a JSON of course. We can filter them out then?The text was updated successfully, but these errors were encountered: