Skip to content

Instantly share code, notes, and snippets.

@eduardopc
Last active December 12, 2020 04:45
Show Gist options
  • Save eduardopc/002a1b1aa0088bef62817ec601551d10 to your computer and use it in GitHub Desktop.
Save eduardopc/002a1b1aa0088bef62817ec601551d10 to your computer and use it in GitHub Desktop.
import { Field, ObjectType, ID } from 'type-graphql';
import { prop as Property, getModelForClass } from '@typegoose/typegoose';
@ObjectType({ description: "The Animal Model" })
export class Animal {
@Field(() => ID)
readonly id: string;
@Field()
@Property({ required: true })
animal: string;
@Field()
@Property({ required: true })
emoji: string
}
export const AnimalModel = getModelForClass(Animal);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment