UNPKG

1.26 kBTypeScriptView Raw
1import { GraphQLSchema } from 'graphql';
2import { Request, ExecutionResult } from '@graphql-tools/utils';
3import { Transform, DelegationContext, SubschemaConfig } from '@graphql-tools/delegate';
4import { LeafValueTransformer } from '../types';
5export interface MapLeafValuesTransformationContext {
6 transformedRequest: Request;
7}
8export default class MapLeafValues implements Transform<MapLeafValuesTransformationContext> {
9 private readonly inputValueTransformer;
10 private readonly outputValueTransformer;
11 private readonly resultVisitorMap;
12 private originalWrappingSchema;
13 private typeInfo;
14 constructor(inputValueTransformer: LeafValueTransformer, outputValueTransformer: LeafValueTransformer);
15 transformSchema(originalWrappingSchema: GraphQLSchema, _subschemaConfig: SubschemaConfig, _transformedSchema?: GraphQLSchema): GraphQLSchema;
16 transformRequest(originalRequest: Request, _delegationContext: DelegationContext, transformationContext?: MapLeafValuesTransformationContext): Request;
17 transformResult(originalResult: ExecutionResult, _delegationContext: DelegationContext, transformationContext?: MapLeafValuesTransformationContext): ExecutionResult;
18 private transformOperations;
19 private transformFieldNode;
20}