How to search on a @connection with AWS Amplify

Viewed 108

So I have 3 collections in my schema

type User @model(subscriptions: null)  {
  id: ID!
  name: String
  email: String
  events: [EventUser] @connection(keyName: "byUser", fields: ["id"])
}
type Event @model
  @key(name: "byApiKey", fields: ["apiKey"])
  @key(name: "byOrganization", fields: ["organizationID"], queryField: "eventByOrganization")
  {
  id: ID!
  apiKey: ID!
  title: String
  participants: [EventUser] @connection(keyName: "byEvent", fields: ["id"])
}

type EventUser @model
  @key(name: "byUser", fields: ["userID"], queryField: "eventByUser")
  @key(name: "byEvent", fields: ["eventID"], queryField: "userByEvent")    {
  id: ID!
  userID: ID!
  eventID: ID!
  user: User! @connection(fields: ["userID"])
  event: Event! @connection(fields: ["eventID"])
}

And I am trying to search the EventUser collection by eventID and user.name. Is there some piece of amplify that can enable me search by the user.name and return the EventUser collection?

0 Answers
Related