Amazon web services AWS AppSync订阅参数不工作

Amazon web services AWS AppSync订阅参数不工作,amazon-web-services,graphql,aws-appsync,Amazon Web Services,Graphql,Aws Appsync,我对AWS AppSync的订阅非常着迷。我的问题是,我不知道如何获得过滤订阅。当我将任何参数传递给订阅服务器时,我没有得到任何回报 我错过了什么 在schema.graphql中,我的突变如下 testMutation( id: String!, val: String! ): TestItem! subscribeToAllTestMutations: TestItem! @aws_subscribe(mutations: ["testMutat

我对AWS AppSync的订阅非常着迷。我的问题是,我不知道如何获得过滤订阅。当我将任何参数传递给订阅服务器时,我没有得到任何回报

我错过了什么


schema.graphql
中,我的突变如下

  testMutation(
    id: String!,
    val: String!
  ): TestItem!
  subscribeToAllTestMutations: TestItem!
  @aws_subscribe(mutations: ["testMutation"])
我的“一网打尽”订阅服务器如下所示

  testMutation(
    id: String!,
    val: String!
  ): TestItem!
  subscribeToAllTestMutations: TestItem!
  @aws_subscribe(mutations: ["testMutation"])
有问题的订阅服务器如下所示:

  subscribeToTestMutation(id: String!): TestItem!
  @aws_subscribe(mutations: ["testMutation"])

当我运行此程序时:

mutation {
  testMutation(
    id: "123-test",
    val:"Hey man"
  ) {
    id
    val
  }
}
我得到的答复是:

{
  "data": {
    "testMutation": {
      "id": "123-test",
      "val": "Hey man",
      "__typename": "TestItem"
    }
  }
}
当我运行此命令时,我得到了相同的结果:

 subscription {
   subscribeToAllTestMutations {
     id
     val
   }
 }
但是当我通过ID时,我什么都没有,这让我变得疯狂:

subscription {
  subscribeToTestMutation(
    id: "123-test"
  ) {
    id
    val
  }
}

我想这可能与我的映射模板有关,但我不知道如何解决它

目前,出于测试目的,我只需使用我的请求映射模板像这样传递数据:

{
  "version": "2017-02-28",
  "payload": $utils.toJson($context.arguments)
}
对于解析器映射模板,我只需执行以下操作:

$utils.toJson($context.result)

求求你,如果有人能帮我,你会救我的