hey guys how can i make this below worked out as i...
# orm-help
s
hey guys how can i make this below worked out as in USER type i'll have [ConversationList!]! type ConversationList { id: ID! @id owner: User! users: User! messages: String! }
r
Hey @saketh kumar 👋 You would need to create your datamodel as follows:
Copy code
type User {
  id: ID! @id
  createdAt: DateTime! @createdAt
  updatedAt: DateTime! @updatedAt
  active: Boolean! @default(value: true)
  email: String! @unique
  friends: [User!]! @relation(name: "Friends")
  conversations: [ConversationList!]! @relation(name: "Conversations")
}

type ConversationList {
  id: ID! @id
  users: [User!]! @relation(name: "Conversations")
  messages: String!
}
So you will be able to query the conversations each User has as well as Users involved in a conversation.
s
i have tried this but still i'm finding difficulties while setting user records while creating a new conversation main problem is coming up when i want to test manually in prisma while in conversation i'm creating a new record but when i set some other records its kind of hanged or irresponsive
r
Could you send the mutation you're using to create a new conversation?
s
i havent wote any mutation i was just trying to check whether its working in prisma admin workspace