UNPKG

1.69 kBTypeScriptView Raw
1/**
2 * The API surface of this module has been heavily inspired by the "type-graphql" library (https://github.com/MichalLytek/type-graphql), originally designed & released by Michal Lytek.
3 * In the v6 major release of NestJS, we introduced the code-first approach as a compatibility layer between this package and the `@nestjs/graphql` module.
4 * Eventually, our team decided to reimplement all the features from scratch due to a lack of flexibility.
5 * To avoid numerous breaking changes, the public API is backward-compatible and may resemble "type-graphql".
6 */
7/**
8 * Interface defining options that can be passed to `@ObjectType()` decorator
9 */
10export interface ObjectTypeOptions {
11 /**
12 * Description of the input type.
13 */
14 description?: string;
15 /**
16 * If `true`, type will not be registered in the schema.
17 */
18 isAbstract?: boolean;
19 /**
20 * Interfaces implemented by this object type.
21 */
22 implements?: Function | Function[] | (() => Function | Function[]);
23 /**
24 * If `true`, direct descendant classes will inherit the parent's description if own description is not set.
25 * Also works on classes marked with `isAbstract: true`.
26 */
27 inheritDescription?: boolean;
28}
29/**
30 * Decorator that marks a class as a GraphQL type.
31 */
32export declare function ObjectType(): ClassDecorator;
33/**
34 * Decorator that marks a class as a GraphQL type.
35 */
36export declare function ObjectType(options: ObjectTypeOptions): ClassDecorator;
37/**
38 * Decorator that marks a class as a GraphQL type.
39 */
40export declare function ObjectType(name: string, options?: ObjectTypeOptions): ClassDecorator;
41//# sourceMappingURL=object-type.decorator.d.ts.map
\No newline at end of file