I'm following this iOS sample app to integrate AppSync.
I'm trying to paginate comments of an individual event. I don't know how to pass field parameters to comments
field of the Event
type. Introspection doesn't bring any valuable leads.
This is what I have right now:
let eventQuery = GetEventQuery(id: event.id)
appSyncClient?.fetch(query: eventQuery, cachePolicy: cachePolicy) { result, error in }
This is what I want as imaginary code:
let eventQuery = GetEventQuery(id: event.id, comments: {limit:5})
appSyncClient?.fetch(query: eventQuery, cachePolicy: cachePolicy) { result, error in }
In the AWS console, I can pass parameters easily to the subfield, but I don't know how to do this with autogenerated code. So this question is not about graphQL itself but amplify generated code.
query ListEvents {
listEvents {
items {
id
name
comments(limit: 1) {
items {
content
}
nextToken
}
}
}
}