PrismaP
Prisma16mo ago
1 reply
mrjfrcdo

How to dynamically get relationships of a from a wrapper function?

I have a function that only returns the value of prisma like so:

findUniqueOrThrow(args: Prisma.SomethingFindUniqueOrThrowArgs) {
  return this.prismaService.something.findUniqueOrThrow(args);
}


but when I try to use it like this. I cannot access the rest of the models.
const something = findUniqueOrThrow({
  id: 1,
  include: {
    somethingElse: true,
  },
});

// something.somethingElse cannot be found by typescript.
Was this page helpful?