如何在AppSync /放大中过滤非标量类型

时间:2019-03-05 10:13:07

标签: amazon-web-services amazon-dynamodb aws-appsync aws-amplify amplifyjs

我正在使用aws-amplify定义我的appsync模式。

我有以下简化的模式:

type Country @model {
  id: ID!
  name: String!
  code: String!
  tracks: [Track] @connection(name: "CountryTrack")
}

type Track @model
  id: ID!
  name: String!
  country: Country! @connection(name: "CountryTrack")
  lng: Float
  lat: Float
  length: Float
  curves: Int
  website: String
  trackImage: String
  information: String
}

Amplify为模型生成FilterInput。但是,它不包括连接类型。

我想根据国家/地区过滤跟踪。

dynamodb表确实具有trackCountryId,在扫描操作中,我可以简单地基于id进行过滤。

但是,这在graphql模式中不起作用。因为trackCountryId未包含在FiterInput中。

有人知道如何解决此问题吗?

0 个答案:

没有答案