Prisma1: Query with Nested Node Arguments Errors

Created on 8 Sep 2018  路  2Comments  路  Source: prisma/prisma1

Describe the bug
When a nested node calls multiple arguments, Prisma errors.

To Reproduce
Steps to reproduce the behavior:

image 2018-09-07 at 3 26 25 pm
image 2018-09-07 at 3 26 51 pm

Expected behavior
Return one post ordered by date.

Versions (please complete the following information):
Prisma 1.15.3

Additional context
Minimal Repo:
https://github.com/LawJolla/prisma-nested-arguments-bug

Thank you!

areengine bu1-repro-available

Most helpful comment

Hey, thanks for reporting this. I can reproduce it. This error is a bit different from #3097 and will require a separate fix.

The problem here is that the query is ordering by something that is not in the selected fields to return. You could select the createdAt field in the query if you are using it for ordering until we have a fix out to prevent this error from happening. This should work:

{
  users{
     id
     posts(orderBy: createdAt_ASC, first: 1){
        createdAt
        id
     }
  }
}

All 2 comments

Hey, thanks for reporting this. I can reproduce it. This error is a bit different from #3097 and will require a separate fix.

The problem here is that the query is ordering by something that is not in the selected fields to return. You could select the createdAt field in the query if you are using it for ordering until we have a fix out to prevent this error from happening. This should work:

{
  users{
     id
     posts(orderBy: createdAt_ASC, first: 1){
        createdAt
        id
     }
  }
}

We just released 1.16.5 which fixes this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

schickling picture schickling  路  3Comments

sorenbs picture sorenbs  路  3Comments

thomaswright picture thomaswright  路  3Comments

AlessandroAnnini picture AlessandroAnnini  路  3Comments

nikolasburk picture nikolasburk  路  3Comments