ferry icon indicating copy to clipboard operation
ferry copied to clipboard

update DateTime type with null

Open bizk-sato opened this issue 2 years ago • 2 comments

I want to update DateTime(GDateTime) value with null. So I did something like below.

final req = GUpsertModelReq((b) {
  b.vars.input.finished_at.value = null;

 return b;
}
await client.request(req)

finished_at in graphql schema is nullable field.

And then I got the error message below. I want to know where to put @nullable?

BuiltValueNestedFieldError (Tried to build class "GupsertModelReq" but nested builder for field "vars" threw: Tried to build class "GupsertModelVars" but nested builder for field "input" threw: Tried to build class "GUpsertModelMutationInput" but nested builder for field "finishedAt" threw: Tried to construct class "GDateTime" with null field "value". This is forbidden; to allow it, mark "value" with @nullable.)

bizk-sato avatar Jan 20 '23 06:01 bizk-sato

finished_at is a variable in your mutation, it's not defined in your schema. you need to check the type of your variable

knaeckeKami avatar Jan 20 '23 08:01 knaeckeKami

Is there a workaround to set a date to null until the PR is finished?

janweinkauff avatar Oct 23 '23 05:10 janweinkauff