Prisma-client-js: 2.0.0-preview023 - message is not defined on large requests with relations

Created on 6 Mar 2020  路  4Comments  路  Source: prisma/prisma-client-js

I have this schema:


model A {
  id         String      @aliedp 
  b     B?
}

model B {
  id String @id
}
````

I have ~2000 A's in the DB. It's a postgresSQL db running  on google cloud.

if I do a graphq-request to get all a's, i get a response:

as {
id
}

returns all entries



but if i want to join in B and fetch all 2000 entries, i get an error

as {
id
b {
id
}
}


it will return:

{
"errors": [
{
"message": "message is not defined",
"locations": [
{
"line": 4,
"column": 5
}
],
"path": [
"a",
1,
"b"
],
"extensions": {
"code": "INTERNAL_SERVER_ERROR"
}
},
{
"message": "message is not defined",
"locations": [
{
"line": 4,
"column": 5
}
],
"path": [
"a",
2,
"b"
],
"extensions": {
"code": "INTERNAL_SERVER_ERROR"
}
},
// and so on

```

if i add a limit (say first 10 entries), it will return (not fast, but without error).

it seems that this overloads the db or so. It seem to have worked in previous version (021) that we used.

I know that this request is too large anyway, but it should not crash the db.

Also the "message is not defined"-error seems to be this: https://github.com/prisma/prisma2/issues/1758, this other issue prevents debugging this, because it does not show the real error behind this.

bu0-needs-info kinbug

Most helpful comment

@pantharshit00 yeah, it seems to work with preview24! also the batching seems now to work (with updated nexus), as the response is now much faster.

All 4 comments

Can you please share the GraphQL server implementation that you are using? I wasn't able to reproduce this with my initial tries.

@pantharshit00 we use nextjs and have a apollo server (apollo-server-micro as this is the way to go with nextjs). The database is a google cloud sql. I guess the database is overloaded in a way or has too many open connections... i can't really tell because of the message syntax bug.

@macrozone I remember we fixed a similar bug recently. Can you please try again this with preview024? Also, if that doesn't fix this, try the latest alpha as well.

To install alpha run:

npm install prisma2@alpha @prisma/client@alpha

@pantharshit00 yeah, it seems to work with preview24! also the batching seems now to work (with updated nexus), as the response is now much faster.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

samrith-s picture samrith-s  路  3Comments

AhmedElywa picture AhmedElywa  路  4Comments

Errorname picture Errorname  路  3Comments

julien1619 picture julien1619  路  3Comments

maartenraes picture maartenraes  路  4Comments