maoosi / prisma-appsync

⚡ Turns your ◭ Prisma Schema into a fully-featured GraphQL API, tailored for AWS AppSync.
https://prisma-appsync.vercel.app
BSD 2-Clause "Simplified" License
226 stars 18 forks source link

Issue: Local dev server reads `undefined` when using nested arrays in query #81

Closed Tenrys closed 1 year ago

Tenrys commented 1 year ago

With this Prisma schema:

model Customer {
  uuid      String   @id @default(uuid())
  firstName          String        @default("")
  lastName           String        @default("")
  email              String        @unique
  phoneUuid          String
  phone              Phone         @relation(fields: [phoneUuid], references: [uuid])
}

And this query:

query MyQuery {
  listCustomers(where: { 
    OR: [
      { firstName: { contains: "bla" } }, 
      { lastName: { contains: "bla" } }
    ] 
  ) {
    uuid
    firstName
    lastName
    email
    phone {
      number
    }
  }
}

GraphQL Yoga seems to be receiving the parameters incorrectly, returning an empty result since Prisma can't understand the request:

image

{
    "data": {
        "listCustomers": []
    }
}

I've tried deploying onto AppSync itself and the query does function over there, so I think it may be some slip-up related to the development server.

maoosi commented 1 year ago

Fix will be released as part of 1.0.0-rc.5.