带有布尔过滤器的 graphql appsync 查询

graphql appsync query with boolean filter

我需要查询所有未完成的项目,其中完成后项目将被赋予状态更改(Completed)加上布尔值isComplete==true

我正在通过 AWS Appsync 测试查询,然后再将它们硬编码到我的应用程序中,但是这个似乎并不有效。我想要 isComplete==falseisComplete==null 的所有项目:布尔逻辑不适用于下面的 input1 变量(0 个结果)。

{"__typename":{"S":"Project"},"addressLine1":{"S":"321 Faith Cir"},"city":{"S":"Perris"},"createdAt":{"S":"2019-03-05T01:01:39.513Z"},"currentOwner":{"S":"pgres52"},"dateRequired":{"S":"2019-03-13-07:00"},"id":{"S":"89a5-42ef7efef8fb"},"status":{"S":"Created"},"statusLastChangedAt":{"S":"2019-03-05T01:01:39.513Z"}}

{
  "input1":{
    "isComplete": {
      "ne": true
    }
  }
}

query listNonCompleteProjects($input1: ModelProjectFilterInput) {
  listProjects(filter: $input1, limit: 20) {
    items {
      id
      currentOwner
      addressLine1
      city
      dateRequired
      isComplete
      statusLastChangedAt
    }
    nextToken
  }
}```

已解决!对此有部分帮助 post:Prisma.io: How do I filter items with certain fields being null?

我能够使用附加参数 status(字符串):

query listNonCompleteProjects($input1: ModelProjectFilterInput) {
  listProjects(filter: $input1, limit: 20) {
    items {
      ...
    }
  }
}
  "input1":{
    "and": [
      {"status": {"notContains": "Complete"}},
      {"isComplete": {
        "ne": true
      }}
    ]
  },