All files / domains/inputObjectType index.ts

72.73% Statements 16/22
50% Branches 3/6
75% Functions 3/4
76.19% Lines 16/21

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 20 21 22 2319x               19x 19x 19x 19x 19x 19x 19x 19x 19x   5x 5x 5x 7x  
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);
  };
}