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
+4 -4
View File
@@ -8,7 +8,7 @@ import debug from 'debug';
import Decimal from 'decimal.js';
import { GraphQLScalarType } from 'graphql';
import { ValueResult, BlockHeight, StateKind } from '@vulcanize/util';
import { ValueResult, BlockHeight, StateKind, jsonBigIntStringReplacer } from '@vulcanize/util';
import { Indexer } from './indexer';
import { EventWatcher } from './events';
@@ -73,19 +73,19 @@ export const createResolvers = async (indexer: Indexer, eventWatcher: EventWatch
},
blog: async (_: any, { id, block = {} }: { id: string, block: BlockHeight }): Promise<Blog | undefined> => {
log('blog', id, block);
log('blog', id, JSON.stringify(block, jsonBigIntStringReplacer));
return indexer.getSubgraphEntity(Blog, id, block);
},
category: async (_: any, { id, block = {} }: { id: string, block: BlockHeight }): Promise<Category | undefined> => {
log('category', id, block);
log('category', id, JSON.stringify(block, jsonBigIntStringReplacer));
return indexer.getSubgraphEntity(Category, id, block);
},
author: async (_: any, { id, block = {} }: { id: string, block: BlockHeight }): Promise<Author | undefined> => {
log('author', id, block);
log('author', id, JSON.stringify(block, jsonBigIntStringReplacer));
return indexer.getSubgraphEntity(Author, id, block);
},