UNPKG

@graphql-tools/wrap

Version:

A set of utils for faster development of GraphQL tools

10 lines (9 loc) 452 B
import TransformObjectFields from './TransformObjectFields.js'; export default class FilterObjectFields { constructor(filter) { this.transformer = new TransformObjectFields((typeName, fieldName, fieldConfig) => filter(typeName, fieldName, fieldConfig) ? undefined : null); } transformSchema(originalWrappingSchema, subschemaConfig) { return this.transformer.transformSchema(originalWrappingSchema, subschemaConfig); } }