Skip to content

Function: InputType()

ts
function InputType(options?): ClassDecorator;

Defined in: packages/apollo/src/decorators/type.decorator.ts:76

Decorator for GraphQL Input Type.

Parameters

ParameterTypeDescription
options?| string | { description?: string; isAbstract?: boolean; name?: string; }Type options or name.

Returns

ClassDecorator

Example

typescript
@InputType()
class CreateUserInput {
  @Field()
  name: string;

  @Field({ nullable: true })
  email?: string;
}

Released under the MIT License.