friebetill
04/10/2020, 9:27 AMlatestStory 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.
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?iandjx
04/10/2020, 1:12 PMfriebetill
04/10/2020, 2:55 PM