1 | import { GraphQLSchema, FieldNode, GraphQLArgument } from 'graphql';
|
2 | import { Request, ExecutionResult } from '@graphql-tools/utils';
|
3 | import { Transform, DelegationContext, SubschemaConfig } from '@graphql-tools/delegate';
|
4 | export default class HoistField implements Transform {
|
5 | private readonly typeName;
|
6 | private readonly newFieldName;
|
7 | private readonly pathToField;
|
8 | private readonly oldFieldName;
|
9 | private readonly argFilters;
|
10 | private readonly argLevels;
|
11 | private readonly transformer;
|
12 | constructor(typeName: string, pathConfig: Array<string | {
|
13 | fieldName: string;
|
14 | argFilter?: (arg: GraphQLArgument) => boolean;
|
15 | }>, newFieldName: string, alias?: string);
|
16 | transformSchema(originalWrappingSchema: GraphQLSchema, subschemaConfig: SubschemaConfig, transformedSchema?: GraphQLSchema): GraphQLSchema;
|
17 | transformRequest(originalRequest: Request, delegationContext: DelegationContext, transformationContext: Record<string, any>): Request;
|
18 | transformResult(originalResult: ExecutionResult, delegationContext: DelegationContext, transformationContext: Record<string, any>): ExecutionResult;
|
19 | }
|
20 | export declare function wrapFieldNode(fieldNode: FieldNode, path: Array<string>, alias: string, argLevels: Record<string, number>): FieldNode;
|
21 | export declare function renameFieldNode(fieldNode: FieldNode, name: string): FieldNode;
|
22 | export declare function unwrapValue(originalValue: any, alias: string): any;
|