@graphprotocol/client-block-tracking
Version:
`graph-client` implements automatic block tracking using `number_gte` filter of `graph-node`. This automates the process [of fetching and tracking the block number of entites](https://thegraph.com/docs/en/developer/distributed-systems/#polling-for-updated
17 lines (16 loc) • 913 B
TypeScript
import { ExecutionResult, ExecutionRequest } from '@graphql-tools/utils';
import { GraphQLSchema, SelectionNode } from 'graphql';
export interface BlockTrackingConfig {
ignoreOperationNames: string[];
ignoreFieldNames: string[];
metaTypeName: string;
blockFieldName: string;
blockNumberFieldName: string;
metaRootFieldName: string;
blockArgumentName: string;
minBlockArgumentName: string;
}
export declare const DEFAULT_CONFIG: BlockTrackingConfig;
export declare const createMetaSelectionNode: (config: BlockTrackingConfig) => SelectionNode;
export declare function transformExecutionRequest(executionRequest: ExecutionRequest, config: BlockTrackingConfig, transformedSchema: GraphQLSchema, batch?: boolean, minBlock?: number): ExecutionRequest;
export declare function getNewBlockNumberFromExecutionResult(originalResult: ExecutionResult<any>, config: BlockTrackingConfig): any;