-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathschema.graphql
More file actions
158 lines (141 loc) · 2.52 KB
/
Copy pathschema.graphql
File metadata and controls
158 lines (141 loc) · 2.52 KB
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
enum form_types{
TEXT
TEXTAREA
CHECKBOX
MULTI_CHECKBOX
}
enum status{
PENDING
WAITLISTED
ACCEPTED
DECLINED
REJECTED
}
enum gender{
MALE
FEMALE
UNDEFINED
}
type Link{
label: String
url: String!
}
input LinkInput{
label: String
url: String!
}
type Question {
id: String!
title: String!
info: String!
options: [String!]!
default: String!
type:form_types!
required: Boolean!
}
input QuestionInput{
id: String!
title: String!
info: String!
options: [String!]!
default: String!
type:form_types!
required: Boolean!
}
type Date{
day: Int!
month: Int!
year: Int!
}
input DateInput{
day: Int!
month: Int!
year: Int!
}
type Response{
question: Question!
answer: [String!]!
}
input ResponseInput{
question: QuestionInput!
answer: [String!]!
}
type User{
id: String!
links: [Link]
status: status!
email: String!
firstname: String!
lastname: String!
gender:gender!
school: String!
bio: String!
photo: String!
created_at: Date!
}
type Application{
id: String!
created_at: Date!
updated_at: Date!
form: Form!
user: User!
responses: [Response]!
}
type Form{
id: String!
title: String!
questions: [Question]!
open: Boolean!
ends_at: Date!
created_at: Date!
}
input CreateUser{
email: String!
firstname: String
lastname: String
gender: gender
school: String
bio: String
photo: String
links: [LinkInput]
}
input UpdateUser{
status: status
email: String
firstname: String
lastname: String
gender:gender
school: String
bio: String
photo: String
links: [LinkInput]
}
input CreateForm{
title: String!
open: Boolean!
ends_at: DateInput!
}
input UpdateForm{
id: String!
title: String!
questions: [QuestionInput!]!
open: Boolean!
ends_at: DateInput!
}
type Query{
# id takes priority if both provided
readUser(email: String, id: String): User!
readApp(id: String!):Application!
readForm(id: String!):Form!
}
type Mutation{
createUser(input: CreateUser!): User!
updateUser(input: UpdateUser!): User!
deleteUser(id: String!): User!
createApp(form: String!, user: String!):Application!
updateApp(id: String!, responses: [ResponseInput!]):Application!
deleteApp(id: String!):Application!
createForm(input:CreateForm!):Form!
updateForm(input:UpdateForm!):Form!
deleteForm(id: String!):Form!
}