Flutter Ferry GraphQL filter by eq null

289 views Asked by At

I am having issues with passing null into graphQL filter variables

GGetPostsReq request = GGetPostsReq.fromJson({
    "vars": {
      "where": {
        "deletedByProfileGuid": {
          "eq": null
        }
      }
    }
  })!;

print(params.vars.toJson()); //{{where: {deletedByProfileGuid: {eq: }}}}

final client = initClient("http://localhost:5034/graphql/");

  client.request(params).listen((response){
      if(response.graphqlErrors != null){
          print("error");
          print(response.graphqlErrors);
      }else{
          print("data");
          print(response.data?.toJson());
      }
  });

Since deletedByProfileGuid: {eq: } is not valid This causes my WebAPI with Hotchocolate GraphQL to error with:

[GraphQLError(message: Unexpected Execution Error, ...

I know this is an error with my flutter-ferry integration because i've run the same query in my playground successfully. I've spent 2 days on this and any guidance would be much appreciated. enter image description here

1

There are 1 answers

0
Sangam Shrestha On

You can't send request with null field. Here is an open issue about this and how to solve it. https://github.com/gql-dart/ferry/issues/473