Prisma1: Incomplete UUID query support with PostgreSQL

Created on 5 Aug 2018  路  4Comments  路  Source: prisma/prisma1

Describe the bug
WhereInput doesn't dispaly ID field when using UUID

To Reproduce
Steps to reproduce the behavior:

  1. Init Prisma
  2. Create relationship with UUID model
type User {
  id: UUID! @unique
  name: String!
  posts: [Post!]!
}

type Post {
  id: UUID! @unique
  body: String!
  author: User!
}
  1. Start container and deploy
  2. Try to find posts by author
query($id: ID!) {
  posts(where: { author: { id: $id } }) {
    id
    body
    author {
      id
    }
  }
}

image

The same query with the default ID works well.

Expected behavior
To behavior as default ID

Versions:

  • Prisma Server: 1.15-alpha

Additional context
I'm a bit afraid to use UUIDs with Prisma in these first steps. Although they scale well in my application I do not know if I can find other problems in the future that can lead to data loss or inconsistency.
Any suggestions from the team to avoid complications in the future regarding IDs?

Despite this, the team is being amazing in implementing the project and creating tools to help developers, keep up the good work! 馃帀馃帀

bu2-confirmed areconnectopostgres bu1-repro-available

Most helpful comment

We're having the same issue. For now we've resorted to using ID's like @maarten00 suggested. Is there an ETA for when Prisma will support UUID's?

All 4 comments

I'm having the same issue and was unsure wether this is a bug or intended behavior. I can confirm this is still an issue with the latest (1.18) version. Is a workaround available?

Same issue on 1.20. Possible workaround is using character instead of uuid on your database, and then using String instead of UUID in your datamodel. But I doubt you'd want to do that..
I certainly don't. Any other ideas? Would be great if UUID would be treated in the same way as ID.

We're having the same issue. For now we've resorted to using ID's like @maarten00 suggested. Is there an ETA for when Prisma will support UUID's?

Any update here?
I'm using prisma with existing postgresql.
It is on production environment, can't migrate the schema.
Also I've tried change prisma SDL from UUID to String, but postgres can't cast character to UUID.

Is there any other workaround?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ragnorc picture ragnorc  路  3Comments

dohomi picture dohomi  路  3Comments

nikolasburk picture nikolasburk  路  3Comments

sorenbs picture sorenbs  路  3Comments

schickling picture schickling  路  3Comments