UNPKG

@nestjs/graphql

Version:

Nest - modern, fast, powerful node.js web framework (@graphql)

53 lines • 1.98 kB
/** * 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. * 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. * Eventually, our team decided to reimplement all the features from scratch due to a lack of flexibility. * To avoid numerous breaking changes, the public API is backward-compatible and may resemble "type-graphql". */ import { RegisterInOption } from '../schema-builder/metadata/index.js'; /** * Interface defining options that can be passed to `@InputType()` decorator. * * @publicApi */ export interface InputTypeOptions { /** * Description of the input type. */ description?: string; /** * If `true`, type will not be registered in the schema. */ isAbstract?: boolean; /** * If 'true', the input type will be '@oneOf' type. * More info about '@oneOf' types in the [GraphQL spec](https://spec.graphql.org/September2025/#sec-OneOf-Input-Objects). */ isOneOf?: boolean; /** * NestJS module that this type belongs to. * When specified, this type will only be included in GraphQL schemas * that include this module via the `include` option. * @see RegisterInOption for details */ registerIn?: RegisterInOption; } /** * Decorator that marks a class as a GraphQL input type. * * @publicApi */ export declare function InputType(): ClassDecorator; /** * Decorator that marks a class as a GraphQL input type. * * @publicApi */ export declare function InputType(options: InputTypeOptions): ClassDecorator; /** * Decorator that marks a class as a GraphQL input type. * * @publicApi */ export declare function InputType(name: string, options?: InputTypeOptions): ClassDecorator; //# sourceMappingURL=input-type.decorator.d.ts.map