Skip to content

Function: InterfaceType()

ts
function InterfaceType(options?): ClassDecorator;

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

Decorator for GraphQL Interface.

Parameters

ParameterTypeDescription
options?| string | { description?: string; name?: string; resolveType?: (value) => string; }Interface options or name.

Returns

ClassDecorator

Example

typescript
@InterfaceType()
abstract class Node {
  @Field()
  id: string;
}

Released under the MIT License.