Hi,
I have an entity that looks like this :
@ObjectType()
@Entity()
export class Post {
@Field(() => ID)
@PrimaryKey()
id!: number;
@Field(() => String)
@Property({ type: 'date' })
createdAt = new Date();
@Field(() => String)
@Property({ type: 'date', onUpdate: () => new Date() })
updatedAt = new Date();
@Field(() => String)
@Property()
title!: string;
}
And a resolver that looks like this :
@Resolver()
export class PostResolver {
@Query(() => [Post])
async posts(@Ctx() { em }: MyContext): Promise<Post[]> {
return em.find(Post, {});
}
}
Unfortunately i keep getting this error
Argument of type '{}' is not assignable to parameter of type 'FilterQuery<Post>'.
Type '{}' is not assignable to type 'number'.
return em.find(Post, {});
and i can’t seem to figure out what im doing wrong because i followed the documentation. I have made the necessary configurations and seeded data to my db. Any advise/recommendations on what i am doing wrong will be appreciated. Thnak you