I am using amplify graphql apis. I have added a few @key
for my search and sort of the events data. Then I have added a custom Query
to search nearby events by lat and long. Now if had to search the nearby events by creatorId
or status
with location
, how do I do it?
type Event @model
@key(name: "byOwnerUser", fields: ["creatorId"])
@searchable
{
id: ID!
name: String!
location: Location
date: AWSDate!
creatorId: ID!
status: Boolean
createdAt: AWSTimestamp
updatedAt: AWSTimestamp
users: [UserEvents] @connection(name: "EventsUser")
}
type Location {
lat: Float!
lon: Float!
}
input LocationInput {
lat: Float
lon: Float
}
type Query {
nearbyEvents(location: LocationInput!, km: Int): EventConnection
}
Do I have to write custom resolvers? Is there a way to do this without custom resolvers? Thank you in advance