UNPKG

992 BTypeScriptView Raw
1import { GraphQLSchema, FieldNode } from 'graphql';
2import { Transform, Request, ExecutionResult } from '@graphql-tools/utils';
3export default class HoistField implements Transform {
4 private readonly typeName;
5 private readonly newFieldName;
6 private readonly pathToField;
7 private readonly oldFieldName;
8 private readonly transformer;
9 constructor(typeName: string, path: Array<string>, newFieldName: string, alias?: string);
10 transformSchema(schema: GraphQLSchema): GraphQLSchema;
11 transformRequest(originalRequest: Request, delegationContext?: Record<string, any>, transformationContext?: Record<string, any>): Request;
12 transformResult(originalResult: ExecutionResult, delegationContext?: Record<string, any>, transformationContext?: Record<string, any>): ExecutionResult;
13}
14export declare function wrapFieldNode(fieldNode: FieldNode, path: Array<string>, alias: string): FieldNode;
15export declare function unwrapValue(originalValue: any, alias: string): any;