UNPKG

@graphql-tools/wrap

Version:

A set of utils for faster development of GraphQL tools

13 lines (12 loc) 746 B
import TransformInputObjectFields from './TransformInputObjectFields.js'; export default class FilterInputObjectFields { constructor(filter, inputObjectNodeTransformer) { this.transformer = new TransformInputObjectFields((typeName, fieldName, inputFieldConfig) => filter(typeName, fieldName, inputFieldConfig) ? undefined : null, undefined, inputObjectNodeTransformer); } transformSchema(originalWrappingSchema, subschemaConfig) { return this.transformer.transformSchema(originalWrappingSchema, subschemaConfig); } transformRequest(originalRequest, delegationContext, transformationContext) { return this.transformer.transformRequest(originalRequest, delegationContext, transformationContext); } }