-
Notifications
You must be signed in to change notification settings - Fork 0
/
model.graphql
executable file
·56 lines (52 loc) · 1.86 KB
/
model.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
47
48
49
50
51
52
53
54
55
56
type User @entity {
active: Boolean! @column(default: false)
email: String! @column(unique: true)
password: String @column
avatarURL: String @column
displayName: String @column
description: String @column
firstName: String @column
lastName: String @column
nickName: String @column
location: String @column
apikeys: [UserAPIKey!]! @relationship(inverse: "user", preload: true)
roles: [Role!]! @relationship(inverse: "users", preload: true)
profiles: [Profile!]! @relationship(inverse: "users", preload: true)
permissions: [Permission!]! @relationship(inverse: "users", preload: true)
}
type UserAPIKey @entity {
key: String! @column(unique: true)
description: String @column
user: User @relationship(inverse: "apikeys", preload: true)
permissions: [Permission!]! @relationship(inverse: "apikeys", preload: true)
}
type Profile @entity {
email: String! @column
externalUserId: String @column
provider: String @column
avatarURL: String @column
name: String @column
firstName: String @column
lastName: String @column
nickName: String @column
description: String @column
location: String @column
users: [User!]! @relationship(inverse: "profiles")
}
type Role @entity {
domain: String! @column # Application domain, name or namespace
name: String! @column
description: String @column
users: [User!]! @relationship(inverse: "roles")
parents: [Role!]! @relationship(inverse: "children")
children: [Role!]! @relationship(inverse: "parents")
permissions: [Permission!]! @relationship(inverse: "roles")
}
type Permission @entity {
domain: String! @column # Application domain, name or namespace
tag: String! @column(unique: true)
description: String! @column
users: [User!]! @relationship(inverse: "permissions")
roles: [Role!]! @relationship(inverse: "permissions")
apikeys: [UserAPIKey!]! @relationship(inverse: "permissions")
}