-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatamodel.graphql
46 lines (43 loc) · 971 Bytes
/
datamodel.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
type Bit {
id: ID! @unique
createdAt: DateTime!
updatedAt: DateTime!
author: User @relation(name: "BitAuthor", onDelete: SET_NULL)
contentHTML: String!
contentText: String!
imageCredit: String
imageURL: String
isPublished: Boolean! @default(value: "false")
metaDescription: String
metaTitle: String
sourceCredit: String
sourceURL: String
tags: [Tag!]! @relation(name: "BitTag", onDelete: SET_NULL)
}
type Tag {
id: ID! @unique
createdAt: DateTime!
updatedAt: DateTime!
createdBy: User
bits: [Bit!]! @relation(name: "BitTag", onDelete: SET_NULL)
name: String! @unique
metaTitle: String
metaDescription: String
slug: String! @unique
}
type User {
id: ID! @unique
bits: [Bit!]! @relation(name: "BitAuthor", onDelete: SET_NULL)
email: String! @unique
name: String!
password: String!
permissions: [Permission]
resetToken: String
resetTokenExpiry: Float
}
enum Permission {
DEVELOPER
ADMIN
AUTHOR
USER
}