-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgamma.graphql
91 lines (87 loc) · 2.75 KB
/
gamma.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
type Gamma
@model(subscriptions: null)
@searchable
@auth(
rules: [
{
allow: private
provider: iam
operations: [create, read, update, delete]
}
{
allow: groups
groups: ["SUPERADMIN"]
operations: [create, read, update, delete]
}
{
allow: owner
ownerField: "organizationID"
identityClaim: "ADMIN"
operations: [create, read, update, delete]
}
{ allow: groups, groups: ["LEADER"], operations: [create, read, update] }
{
allow: owner
ownerField: "sponsorID"
identityClaim: "sub"
operations: [create, read, update, delete]
}
{
allow: owner
ownerField: "ownerEmail"
identityClaim: "email"
operations: [create, read, update, delete]
}
{
allow: owner
ownerField: "organizationID"
identityClaim: "organization"
operations: [read]
}
]
) {
id: ID!
friendlyId: Int
levelID: ID! @index(name: "byStage")
level: Stage @belongsTo(fields: ["levelID"])
levelHistory: [LevelChange] @hasMany(indexName: "byGamma", fields: ["id"])
title: String!
description: String!
# seperately storing measurement field inputs here for filtering, in addition to storing it in additionalfields
measurementFields: [measurementFieldUnit]
additionalFields: [Field]
rankHistory: [rankHistoryUnit]
mapping: GammaZapierMapping @hasOne(fields: ["id"])
userID: ID! @index(name: "byUser", queryField: "GammasByUserID")
organizationID: ID!
@index(
name: "byOrganization"
queryField: "gammasByOrganizationID"
sortKeyFields: ["fixedRank"]
)
@index(name: "byOrganizationAndTitle", sortKeyFields: ["title"])
Organization: Organization @belongsTo(fields: ["organizationID"])
departments: [ID]
# departments: [DepartmentGamma] @hasMany(indexName: "byGamma", fields: ["id"])
UserVotes: [UserVote] @hasMany(indexName: "byGamma", fields: ["id"])
user: User @belongsTo(fields: ["userID"])
ownerEmail: String
hiddenUsers: [HiddenUsersAndHiddenGammas]
@hasMany(indexName: "byGamma", fields: ["id"])
sponsorID: ID @index(name: "bySponsor", queryField: "GammasBySponsorID")
sponsor: User @belongsTo(fields: ["sponsorID"])
contributors: [ID]
# contributors: [GammasAndContributors]
# @hasMany(indexName: "byGamma", fields: ["id"])
linkedTo: [LinkedGammas] @hasMany
userRatings: [UserRating] @hasMany(indexName: "byGamma", fields: ["id"])
fixedRank: Int
@default(value: "-1")
@index(
name: "byFixedRank"
queryField: "GammasByFixedRank"
sortKeyFields: ["organizationID"]
)
rank: [Int] @function(name: "rankCalculator-${env}")
updatedByIAM: Boolean @default(value: "false")
}