【问题标题】:Flutter Ferry GraphQL filter by eq nullFlutter Ferry GraphQL 按 eq null 过滤
【发布时间】:2023-02-06 11:41:02
【问题描述】:

我在将 null 传递给 graphQL 过滤器变量时遇到问题

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());
      }
  });

由于deletedByProfileGuid: {eq: } 无效 这会导致我的带有 Hotchocolate GraphQL 的 WebAPI 出现以下错误:

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

我知道这是我的 flutter-ferry 集成的错误,因为我已经在我的操场上成功运行了相同的查询。我已经在这上面花了 2 天时间,非常感谢任何指导。

【问题讨论】:

    标签: flutter graphql build-runner ferry


    【解决方案1】:

    您不能发送带有空字段的请求。 Here is an open issue about this 以及如何解决它。 https://github.com/gql-dart/ferry/issues/473

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-02-11
      • 2022-10-20
      • 2022-01-16
      • 2011-12-03
      • 1970-01-01
      • 2021-05-28
      • 2020-07-21
      • 2019-12-29
      相关资源
      最近更新 更多