Hey, quick question, is something like `latestStor...
# orm-help
f
Hey, quick question, is something like
latestStory
in Prisma 1 possible? I’ve only seen this with strings, but with complex data types, Prisma tells me that there must be a relation. But I want to implement the resolver to access the stories and get the latest story without changing the underlying database. I have to do this for backward compatibility.
Copy code
type User {
  id: ID! @unique
  stories: [Story]! @relation(name: "stories")
  latestStory: Story
}

type Story {
  id: ID! @unique
  text: String!
  author: User! @relation(name: "stories", link: INLINE)
  createdAt: DateTime! @createdAt
}
If it is not possible, is it possible with prisma 2?
i
you still need to add relations for prisma 2.
f
Thanks that is unfortunate.