Prisma1: The 'first' modifier is not working correctly in nested (one-to-many) nodes using PostgreSQL.

Created on 14 Sep 2018  路  4Comments  路  Source: prisma/prisma1

Describe the bug
The 'first' modifier is not working correctly in nested (one-to-many) nodes using PostgreSQL.

To Reproduce
Steps to reproduce the behavior:

  1. Init a prisma instance selecting the Docker local installation option with PostgreSQL as database
  2. Deploy this datamodel User, University, Career datamodel
type User {
  id: ID! @unique
  name: String
  interestedIn: [University!]!
}

type University {
  id: ID! @unique
  name: String
  careers: [Career!]!
}

type Career {
  id: ID! @unique
  name: String
}
  1. Load this data example-data
  2. Try to get all the users, with all the universities they are interested in, but only including the first 10 careers for those universities
query{
  users{
    name
    interestedIn{
      name
      careers(first: 10){
        name
      }
    }
  }
}

Expected behavior
It should return the only user (username=Federico) with the three loaded universities with the first 10 careers for each university, but is only returning the first 5 careers for Harvard, the first 5 for Cambridge, and the all 3 careers for Oxford.

Screenshots
image
Versions (please complete the following information):

  • OS: OS X High Sierra
  • prisma CLI: 1.16.2
  • Prisma Server: 1.6.2

    • DB: PostgreSQL 10.5

Additional context
I tried to reproduce this bug using MySQL and it works as expected.

areengine bu1-repro-available

All 4 comments

Thanks for this reproduction @ficolo, I can reproduce it and we'll release a fix shortly.

We just released 1.16.4 which should fix this issue.

Thanks!

I tested and it works as expected.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nikolasburk picture nikolasburk  路  3Comments

jannone picture jannone  路  3Comments

akoenig picture akoenig  路  3Comments

dohomi picture dohomi  路  3Comments

AlessandroAnnini picture AlessandroAnnini  路  3Comments