UNPKG

831 BTypeScriptView Raw
1import { SelectionNode, SelectionSetNode } from 'graphql';
2import { Request, ExecutionResult } from '@graphql-tools/utils';
3import { Transform, DelegationContext } from '@graphql-tools/delegate';
4export declare type QueryWrapper = (subtree: SelectionSetNode) => SelectionNode | SelectionSetNode;
5export default class WrapQuery implements Transform {
6 private readonly wrapper;
7 private readonly extractor;
8 private readonly path;
9 constructor(path: Array<string>, wrapper: QueryWrapper, extractor: (result: any) => any);
10 transformRequest(originalRequest: Request, _delegationContext: DelegationContext, _transformationContext: Record<string, any>): Request;
11 transformResult(originalResult: ExecutionResult, _delegationContext: DelegationContext, _transformationContext: Record<string, any>): ExecutionResult;
12}