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
}
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.
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.
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.