Looking for best practice ideas - with resolvers ...
# orm-help
j
Looking for best practice ideas - with resolvers
Copy code
@ResolveField(() => [JournalTag], { nullable: true })
tags(@Parent() user: User) {
  return user?.tags
}
or
Copy code
@ResolveField(() => [JournalTag], { nullable: true })
tags(@Parent() user: User) {
  return this.data.user.findUnique({where: {id: user.id}}).tags()
}
The first one requires I include the data in the query, the second one doesn’t - what do you guys do?
n
Hey Justin đź‘‹ You might want to look at our Prisma Examples Repository to have a look at our GraphQL examples, you should get an overview of how resolvers are structured from there.