2021-07-08 19:40:14 +02:00
|
|
|
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;
|
2021-07-08 23:58:07 +02:00
|
|
|
|
|
|
|
@Field({ nullable: true })
|
|
|
|
parent?: ItemModel;
|
2021-07-17 18:34:30 +02:00
|
|
|
|
|
|
|
@Field((type) => [ItemModel])
|
|
|
|
children: ItemModel[];
|
2021-07-17 22:51:12 +02:00
|
|
|
|
|
|
|
@Field((type) => [ItemModel], { deprecationReason: 'typeorm issues' })
|
|
|
|
descendents: ItemModel[];
|
2021-07-08 19:40:14 +02:00
|
|
|
}
|