25 lines
506 B
TypeScript
25 lines
506 B
TypeScript
import { Field, ID, ObjectType } from '@nestjs/graphql';
|
|
|
|
@ObjectType('Item', {
|
|
description: 'Either the inventored thing or a box containing them',
|
|
})
|
|
export class ItemModel {
|
|
@Field((type) => ID)
|
|
id: string;
|
|
|
|
@Field()
|
|
name: string;
|
|
|
|
@Field({ nullable: true })
|
|
notes?: string;
|
|
|
|
@Field({ nullable: true })
|
|
parent?: ItemModel;
|
|
|
|
@Field((type) => [ItemModel])
|
|
children: ItemModel[];
|
|
|
|
@Field((type) => [ItemModel], { deprecationReason: 'typeorm issues' })
|
|
descendents: ItemModel[];
|
|
}
|