Schema and Database
The backend for Cassandra was created using GraphQL through Prisma.
To access the playground for testing queries and mutations, or to view the backend documentation, visit the URL address:
1
https://eu1.prisma.sh/tim-dommett/demo/dev
Copied!
This can also be used as the http endpoint for any frontend development. (This database endpoint is safe for use and to be distributed as no payment information has been associated to this account)
The schema design is as follows:
1
type User {
2
id: ID! @id
3
userName: String!
4
email: String
5
password: String!
6
reviews: [Review!]! @relation(name: "UserReviews")
7
comments: [Comment!]! @relation(name: "UserComments")
8
votes: [Vote!]! @relation(name: "UserVotes")
9
}
10
​
11
​
12
type Video {
13
id: ID! @id
14
title: String
15
description: String
16
externalURL: String
17
categories: [Category!]! @relation(name: "VideoCategory")
18
reviews: [Review!]! @relation(name: "VideoReview")
19
comments: [Comment!]! @relation(name: "VideoComment")
20
votes: [Vote!]! @relation(name: "VideoVote")
21
}
22
​
23
type ExternalResource {
24
id: ID! @id
25
title: String
26
description: String
27
linkURL: String
28
logoURL: String
29
categories: [Category!]! @relation(name: "ResourceCategory")
30
reviews: [Review!]! @relation(name: "ResourceReview")
31
comments: [Comment!]! @relation(name: "ResourceComment")
32
votes: [Vote!]! @relation(name: "ResourceVote")
33
}
34
​
35
type Review {
36
id: ID! @id
37
rating: Int!
38
review: String!
39
user: User @relation(name: "UserReviews")
40
externalResource: ExternalResource @relation(name: "ResourceReview")
41
video: Video @relation(name: "VideoReview")
42
}
43
​
44
type Comment {
45
id: ID! @id
46
comment: String!
47
user: User @relation(name: "UserComments")
48
externalResource: ExternalResource @relation(name: "ResourceComment")
49
video: Video @relation(name: "VideoComment")
50
}
51
​
52
type Vote {
53
id: ID! @id
54
positive: Boolean! @default(value: true)
55
user: User @relation(name: "UserVotes")
56
externalResource: ExternalResource @relation(name: "ResourceVote")
57
video: Video @relation(name: "VideoVote")
58
}
59
​
60
type Category {
61
id: ID! @id
62
category: String
63
video: Video @relation(name: "VideoCategory")
64
externalResource: ExternalResource @relation(name: "ResourceCategory")
65
}
66
​
67
​
68
​
69
​
Copied!
​
Last modified 2yr ago
Copy link