The following query against protofire/roken-registry(QmaTK1m8VszFp7iijbWrX65iN8e5zogvJYvUAck7HEvAtQ) shows the problem:
query getTokensWithEvents {
tokens(first: 2) {
id
symbol
events(first: 5, orderBy: timestamp, orderDirection: desc) {
__typename
id
}
}
}
The result has 20 events for each token, rather than the 5 that were requested. The problem is in the GraphQL processing (graphql::store::prefetch), the underlying SQL query correctly returns 5 events for each token. The first 5 events for each token are the requested events in the correct order.