UNPKG

@graphql-mesh/transform-filter-schema

Version:
15 lines (14 loc) 458 B
import BareFilter from './bareFilter.js'; import WrapFilter from './wrapFilter.js'; export default (function FilterTransform(options) { if (Array.isArray(options.config)) { return new WrapFilter({ ...options, config: { mode: 'wrap', filters: options.config, }, }); } return options.config.mode === 'bare' ? new BareFilter(options) : new WrapFilter(options); });