All files / domains/inputObjectType index.ts

72.73% Statements 16/22
50% Branches 3/6
75% Functions 3/4
75% Lines 15/20

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2017x               17x 17x 17x 17x 17x 17x 17x 17x 17x   5x 5x
import { compileInputObjectTypeWithConfig } from './compiler';
import { inputObjectTypeRegistry } from './registry';

export { compileInputObjectType } from './compiler';
export { InputObjectTypeError } from './error';
export { inputObjectTypeRegistry } from './registry';

export interface InputObjectTypeOptions {
  name?: string;
  description?: string;
}
 
export function InputObjectType(options?: InputObjectTypeOptions): ClassDecorator {
  return (target: Function) => {
    const config = { name: target.name, ...options };
    const inputTypeCompiler = () => compileInputObjectTypeWithConfig(target, config);
    inputObjectTypeRegistry.set(target, inputTypeCompiler);
  };
}