Prisma1: Nested List Items Are Not Filtering (Prisma Client)

Created on 18 Sep 2018  路  5Comments  路  Source: prisma/prisma1

Describe the bug
Skip and First does not return accurate results from related sub selections. Instead of filtering the results the entire collection is returned. orderBy works fine. first, skip do not work. When filtering the type directly filtering works fine, just not with a nested query.

from datamodel.prisma

type User {
  id: ID! @unique
  username: String! @unique
  email: String! @unique
  password: String!
  logs: [Log!]! @relation(name:"UserLogs", onDelete: CASCADE)
  sets: [Set!]! @relation(name:"UserSets", onDelete: CASCADE)
}

type Log {
  id: ID! @unique
  created_at: DateTime!
  sets: [Set!]! @relation(name: "SetsOnLog", onDelete: CASCADE)
  user: User! @relation(name:"UserLogs", onDelete: SET_NULL)
}

type Set {
  id: ID! @unique
  created_at: DateTime!
  movement: Movement!
  reps: Int!
  weight: Float!
  unit: String!
  user: User! @relation(name:"UserSets", onDelete: SET_NULL)
  log: Log! @relation(name: "SetsOnLog", onDelete: SET_NULL)
}

Expected behavior
(first: 1, skip:0) should return the first log on user not all logs on user...

Screenshots
If applicable, add screenshots to help explain your problem.

screen shot 307
screen shot 308

Versions (please complete the following information):

  • OS: OS X High Sierra
  • prisma CLI: prisma/1.17.0-beta.16 (darwin-x64) node-v9.3.0
  • "prisma-client-lib": "^0.2.58"

Additional context

  • deployed to heroku w/ postgres

I believe this to be a bug but perhaps I've missed something?

repo here:

bu1-repro-available

Most helpful comment

Thanks for filing this bug and providing a reproduction. It seems to only affect Postgres and a fix should be coming out soon.

All 5 comments

Things are seeming very inconsistent in general... not quite entirely broken. But I'm very confused...

Anotha One.

screen shot 310

This one has 4 entries... and shows three when asked for one.

Thanks for filing this bug and providing a reproduction. It seems to only affect Postgres and a fix should be coming out soon.

I think this is the same as #3097

Oh good! Thanks! I thought I was losing my mind for a second :)

We just released 1.16.4 which should fix this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sorenbs picture sorenbs  路  3Comments

jannone picture jannone  路  3Comments

nikolasburk picture nikolasburk  路  3Comments

AlessandroAnnini picture AlessandroAnnini  路  3Comments

akoenig picture akoenig  路  3Comments