Below I have two Properties on my GraphQL Schema. They are both of types number, however I'm quite sure you have to explicitly set them to () => Int. This works in my second @Prop scene_description, as it's only 1 argument. However for the top @Prop tvshow_episode, it doesn't let me both explicitly declare an Int, and have options like unique and index. Can someone explain the difference to me here and what is the best practice?
import { Int } from '@nestjs/graphql';
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { Document } from 'mongoose';
export type SongToEpisodeDocument = SongToEpisode & Document;
@Schema({
timestamps: true,
})
export class SongToEpisode {
@Prop(() => Int, { unique: true, index: true })
tvshow_episode: number;
@Prop(() => Int)
scene_description: number;
}
The error it gives is Expected 0-1 arguments, but got 2.ts(2554)