Prisma client returns undefined

Viewed 315

I'm new to using the Prisma client (With NodeJS & Postgres) and have hit an issue similar to this question, but the answer doesn't fix the issue for me.

I'm seeing that the Prisma client correctly generates the SQL for my queries, but always seems to return undefined.

Example:

const result = await this.databaseService.venue.findFirst({
      where: venueWhereUniqueInput,
      include: {
        bookingProvider: true,
      },
    });

Since the SQL is correct and I have manually run the SQL to check records are returned, I can only assume there's an issue with Prisma mapping the results to my model.

I have tried the following:

  1. Checked if there's any outstanding migrations:

npx prisma migrate dev --name name_of_stuff

npx prisma migrate dev

  1. Generated the Primsa models (Typescript generated models look correct)

npx prisma generate

  1. Turned on verbose logging to check for any errors

export DEBUG="*"

But alas, I keep getting undefined results, please can someone advise how this can be resolved, many thanks!

Prisma version: "prisma": "^3.5.0",

0 Answers
Related