gql-dart / ferry

Stream-based strongly typed GraphQL client for Dart
https://ferrygraphql.com/
MIT License
602 stars 116 forks source link

update DateTime type with null #474

Open bizk-sato opened 1 year ago

bizk-sato commented 1 year ago

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.)
knaeckeKami commented 1 year ago

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

janweinkauff commented 11 months ago

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