UNPKG

@graphql-tools/wrap

Version:

A set of utils for faster development of GraphQL tools

16 lines (15 loc) 682 B
import TransformObjectFields from './TransformObjectFields.js'; export default class RenameObjectFields { constructor(renamer) { this.transformer = new TransformObjectFields((typeName, fieldName, fieldConfig) => [ renamer(typeName, fieldName, fieldConfig), fieldConfig, ]); } transformSchema(originalWrappingSchema, subschemaConfig) { return this.transformer.transformSchema(originalWrappingSchema, subschemaConfig); } transformRequest(originalRequest, delegationContext, transformationContext) { return this.transformer.transformRequest(originalRequest, delegationContext, transformationContext); } }