Skip to content

Commit 49d8870

Browse files
Pg/page by logindex (#10738)
* Page through logs by logPosition * Fix variable name and add logPosition to query Co-authored-by: Paul Gebheim <[email protected]> Co-authored-by: Paul Gebheim <[email protected]>
1 parent c4c0119 commit 49d8870

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/augur-sdk/src/graph/GraphQLLogProvider.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const eventFields = {
4646
"cancelZeroXOrder": ["universe", "market", "account", "outcome", "price", "amount", "orderType", "orderHash"]
4747
}
4848

49-
const GENERIC_LOG_FIELDS = ["name", "blockNumber", "logIndex"];
49+
const GENERIC_LOG_FIELDS = ["name", "blockNumber", "logIndex", "logPosition"];
5050

5151
const entityPluralSuffix = 'Events';
5252

@@ -71,7 +71,7 @@ function buildQuery(fromBlockNumber: number, toBlockNumber: number, logFieldDesc
7171

7272
// When a particular entity type has no more logs to fetch it is removed from
7373
// `lastLogPositions` -- which means that we can skip it when fetching
74-
if(typeof lastLogPositions === "undefined") continue;
74+
if(typeof lastLogPosition === "undefined") continue;
7575

7676
const fields = GENERIC_LOG_FIELDS.concat(eventFields);
7777
eventQueries += `${entityName}(where: { blockNumber_gte: ${fromBlockNumber}, blockNumber_lte: ${toBlockNumber}, logPosition_gt: ${JSON.stringify(lastLogPosition)}}, first: 1000) {\n${fields.join(",\n")}}\n`;

0 commit comments

Comments
 (0)