# All files / domains/objectType index.ts

73.91% Statements 17/23
50% Branches 3/6
75% Functions 3/4
77.27% Lines 17/22

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
    2120x

    20x
    20x
    20x
    20x
    20x
    20x
    20x
    20x
    20x
    20x

    76x
    76ximport { compileObjectTypeWithConfig } from './compiler';
    import { objectTypeRegistry } from './registry';

    export { compileObjectType } from './compiler';
    export { ObjectTypeError } from './error';
    export { objectTypeRegistry, inputTypeRegistry } from './registry';

    export interface ObjectTypeOptions {
      name?: string;
      description?: string;
    }

    export function ObjectType(options?: ObjectTypeOptions): ClassDecorator {
      return (target: Function) => {
        const config = { name: target.name, ...options };
        const outputTypeCompiler = () =>
          compileObjectTypeWithConfig(target, config);
        objectTypeRegistry.set(target, outputTypeCompiler);
      };
    }