Prisma1: Combining `first` + `orderBy` in create mutation results in internal server error

Created on 13 Sep 2018  路  7Comments  路  Source: prisma/prisma1

Describe the bug

Combining where.first + where.orderBy in create mutation = internal server error

Looks like #2786 (but this one is now solved)

To Reproduce

datamodel.graphql

type Foo {
    id: ID! @unique
    bars: [Bar!]!
}

type Bar {
    id: ID! @unique
    quantity: Int!
}

Query causing internal server error

mutation {
  createFoo(
    data: {
      bars: {
        create: [
          { quantity: 1 }
          { quantity: 2 }
        ]
      }
    }
  ) {
    id
    bars(first: 1, orderBy: createdAt_DESC) {
      quantity
    }
  }
}

Whoops

{
  "data": {
    "createFoo": {
      "id": "cjm0ms9ed01ty0b77x9hudsoc",
      "bars": null
    }
  },
  "errors": [
    {
      "message": "Whoops. Looks like an internal server error. Search your server logs for request ID: local:api:cjm0ms9e801tw0b77c4bm2ypq",
      "path": [
        "createFoo",
        "bars"
      ],
      "locations": [
        {
          "line": 4,
          "column": 5
        }
      ],
      "requestId": "local:api:cjm0ms9e801tw0b77c4bm2ypq"
    }
  ]
}

Expected behavior

no internal server error would be ncie

Screenshots

If applicable, add screenshots to help explain your problem.

Versions (please complete the following information):

  • Prisma Server: 1.16.1
bu2-confirmed areengine

All 7 comments

I am able to reproduce this with server version: prismagraphql/prisma:1.16-beta

Can you share the actual internal server error from your server logs?

@marktani as far as I can remember nothing was printed on stdout, where are prisma logs? anyway you can easily reproduce it, if not I can update reproduction steps.

Please see my comment on https://github.com/prisma/prisma/issues/3040 to see how to circumvent this problem until we release a fix.

We just released 1.16.5 which fixes this issue.

@do4gr thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

akoenig picture akoenig  路  3Comments

marktani picture marktani  路  3Comments

schickling picture schickling  路  3Comments

ragnorc picture ragnorc  路  3Comments

sorenbs picture sorenbs  路  3Comments