Skip to content
Snippets Groups Projects
Commit dcc5928f authored by Steve Reis's avatar Steve Reis
Browse files

Refactor models (added entity parent class)

parent a3f65774
No related branches found
No related tags found
No related merge requests found
import { Field, ObjectType } from '@nestjs/graphql';
import { ObjectType } from '@nestjs/graphql';
import { Entity } from './entity.model';
@ObjectType()
export class Category {
@Field()
id: string;
@Field()
label: string;
}
export class Category extends Entity {}
import { Field, ObjectType } from '@nestjs/graphql';
@ObjectType()
export class Entity {
@Field()
id: string;
@Field({ nullable: true })
label: string;
}
import { Field, ObjectType } from '@nestjs/graphql';
import { Entity } from './entity.model';
import { Variable } from './variable.model';
@ObjectType()
export class Group {
@Field()
id: string;
@Field()
label: string;
export class Group extends Entity {
@Field({ nullable: true })
description?: string;
......
import { Field, ObjectType } from '@nestjs/graphql';
import { Category } from './category.model';
import { Entity } from './entity.model';
import { Group } from './group.model';
@ObjectType()
export class Variable {
@Field()
id: string;
@Field({ nullable: true })
label?: string;
export class Variable extends Entity {
@Field()
type: string;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment