Add config for query limit in compare CLI (#175)

* Add config for query limit in compare CLI

* Fix JSON stringify bigint for GQL query params

* Take last N entity ids to compare in GQL
This commit is contained in:
2022-09-08 16:54:02 +05:30
committed by GitHub
parent 93584bf28d
commit 4e5ec36f07
6 changed files with 41 additions and 31 deletions
@@ -8,7 +8,7 @@ import debug from 'debug';
import Decimal from 'decimal.js';
import { GraphQLScalarType } from 'graphql';
import { ValueResult, BlockHeight, StateKind, gqlTotalQueryCount, gqlQueryCount } from '@vulcanize/util';
import { ValueResult, BlockHeight, StateKind, gqlTotalQueryCount, gqlQueryCount, jsonBigIntStringReplacer } from '@vulcanize/util';
import { Indexer } from './indexer';
import { EventWatcher } from './events';
@@ -79,7 +79,7 @@ export const createResolvers = async (indexer: Indexer, eventWatcher: EventWatch
{{~#each subgraphQueries}}
{{this.queryName}}: async (_: any, { id, block = {} }: { id: string, block: BlockHeight }) => {
log('{{this.queryName}}', id, block);
log('{{this.queryName}}', id, JSON.stringify(block, jsonBigIntStringReplacer));
gqlTotalQueryCount.inc(1);
gqlQueryCount.labels('{{this.queryName}}').inc(1);