If I wanted to order-by-predecessor-successor rela...
# orm-help
i
If I wanted to order-by-predecessor-successor relationship, is there a conventional, non-raw-query method for doing this with Prisma@3+? For instance, I've got a model:
Copy code
model OrderedNode {
  id                      String       @id @default(uuid()) @db.Uuid
  predecessor_id          String?      @unique @db.Uuid
  predecessor             OrderedNode? @relation("predecessor_successor", fields: [predecessor_id], references: [id])
  successor               OrderedNode? @relation("predecessor_successor")
}
and I want the element with
predecessor_id = null
to show up first, and
successor = null
to show up last.
n
Hey Ian 👋 Not at the moment, though we have a Feature Request for the same scenario that you are looking for: Allow sorting by nulls first/nulls last If you could leave a 👍 to the Feature Request it would help us in prioritising it.
i
@Nurul again with the solid answers. Thanks much
🙌 1