-
-
Save bartosz-maciaszek/6e033ccfbaf36993682d98841fffb0ee to your computer and use it in GitHub Desktop.
datamodel.prisma
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type User { | |
id: ID! @id | |
... | |
displayName: String! | |
... | |
friendships: [Friendship!] | |
friendshipRequestsSent: [FriendshipRequest!] @relation(name: "FriendshipRequestsSent") | |
friendshipRequestsReceived: [FriendshipRequest!] @relation(name: "FriendshipRequestsReceived") | |
.... | |
} | |
type Friendship { | |
id: ID! @id | |
... | |
users: [User!]! | |
... | |
} | |
type FriendshipRequest { | |
id: ID! @id | |
... | |
from: User! @relation(name: "FriendshipRequestsSent") | |
to: User! @relation(name: "FriendshipRequestsReceived") | |
status: FriendshipRequestStatus! @default(value: PENDING) | |
... | |
} | |
enum FriendshipRequestStatus { | |
PENDING | |
ACCEPTED | |
REJECTED | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment