Prisma-client-js: Error occurred during query validation & transformation

Created on 19 Aug 2020  Â·  2Comments  Â·  Source: prisma/prisma-client-js

Bug description

Somehow the following query produces the following error: Error occurred during query validation & transformation

How to reproduce

const users = await prisma.user.findMany({
  where: {
    participants: {
      some: {
        registrations: {
          some: {
            eventOptionId: {
              equals: 'tl202007-rsb1'
            }
          }
        }
      }
    }
  },
  select: {
    id: true
  }
})
Query (object)
  ↳ findManyUser (field)
    ↳ where (argument)
      ↳ UserWhereInput (object)
        ↳ participants (field)
          ↳ ParticipantListRelationFilter (object)
            ↳ is (field)
              ↳ Field does not exist on enclosing type.` at `.Query.findManyUser.where.UserWhereInput.participants.ParticipantListRelationFilter.is`

Expected behavior

I expect this query to show me a list of users who participated via registrations in at least one particular event option.

Prisma information

model User {
  participants   Participant[] @relation("RUserToParticipants")
}

model Participant {
  registrations Registration[] @relation("RParticipantToRegistrations")
  user          User           @relation("RUserToParticipants", fields: [userId], references: [userId])
  userId        String
}

model Registration {
  eventOption       EventOption      @relation("REventOptionToRegistrations", fields: [eventOptionId], references: [eventOptionId])
  eventOptionId     String
  participant       Participant      @relation("RParticipantToRegistrations", fields: [participantId], references: [participantId])
  participantId     String
}

Environment & setup

  • OS: macOS
  • Database: PostgreSQL
  • Node.js version: 12.6.0
  • Prisma version: 2.5.0-dev.73
bu1-repro-available kinbug

All 2 comments

Fixed in 2.5.1

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AhmedElywa picture AhmedElywa  Â·  4Comments

Errorname picture Errorname  Â·  3Comments

macrozone picture macrozone  Â·  4Comments

divyenduz picture divyenduz  Â·  3Comments

divyenduz picture divyenduz  Â·  3Comments