-
Notifications
You must be signed in to change notification settings - Fork 1
/
api.graphql
212 lines (189 loc) · 6.8 KB
/
api.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
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
schema {
query: Query
mutation: Mutation
subscription: Subscription,
}
# The root mutation type, use it to change things
type Mutation {
# Check-in or check-out a user by specifying the tag name. Check-in when checkin is set to true; check-out when checkin is set to false
check_in(user: ID!, tag: String!, checkin: Boolean!): UserAndTags
# Add tag to all users
add_tag(tag: String!, start: String, end: String, warnOnDuplicates: Boolean = false): Tag
}
# The root query type, use to query data
type Query {
# Get a list of unique tags currently available to set.
# set only_current to true to only get events that are currently happening based on their start/end times
tags(only_current: Boolean): [Tag!]!
# Retrieve user through a user ID or through the token passed to
# Query. Leave id empty if you'd like to view the currently logged in
# user.
user(id: ID!): UserAndTags
# All the users in the database, useful for polling for new user information.
# This is paginated, n is the number of results, and pagination_token is the last ID
# seen from the latest page retrieved, if you want the first page leave this out.
users(pagination_token: ID, n: Int!, filter: UserFilter): [UserAndTags!]!
# Search through a user's name and email through regex
search_user_simple(search: String!, use_regex: Boolean = false, offset: Int!, n: Int!, filter: UserFilter): [UserAndTags!]!
# All possible application question branches
application_branches: [String!]!
# All possible confirmation question branches
confirmation_branches: [String!]!
# All possible question branches from all types!
question_branches: [String!]!
# All possible question names, or names of question in a branch
question_names(branch: String): [String!]
# Counts of checked in users per tag.
# Only includes tags that have at least one user checked in.
tag_counts(tags: [String!]): [TagData]!
}
# The root subscription type, all subscribes go through here
type Subscription {
tag_change: UserAndTags!
}
type UserAndTags {
# Tags associated with a user
tags: [TagState!]!
# Registration info about the user
user: User!
}
# Information about checkin tags
type Tag {
# The unique name of the tag (not human label)
name: String!
# The start time of the event associated with the tag
start: String
# The end time of the event associated with the tag
end: String
# Whether to error on a repeated check in/out event for a user and this tag
warnOnDuplicates: Boolean
}
# Record of checked in / checked out activity
type TagDetail {
checked_in: Boolean!
# Date when attendee was checked in or out
checked_in_date: String!
# The username of the admin that checked thte attendee in or out
checked_in_by: String!
# Whether, at the time this checkin attempt was made, the operation was successful. If false, the check-in
# attempt was rejected. If true or the tag has warnOnDuplicates = true, the check-in request was accepted.
checkin_success: Boolean!
}
type TagState {
tag: Tag!
checked_in: Boolean!
# If the tag has warnOnDuplicates = false, then this will always return true. Otherwise, true indicates a valid check-in
# and false indicates a duplicate check-in event (e.g., trying to check-in a user for a tag they are already checked into).
checkin_success: Boolean!
# Date when the attendee was checked in
checked_in_date: String!
# The username of the admin that checked the attendee in
checked_in_by: String!
# Details object for the most recent successful check in/out
last_successful_checkin: TagDetail
# An array of previous checked in / checked out events
details: [TagDetail]!
}
# NOTE: Type names that forward to registration must match the type names
# in the registration API itself for fragments to work currently.
# Registration info about the user
type User {
# User ID, valid across the entire system
id: ID!
# User's full name
name: String!
# User's email
email: String!
# If the user's email is a verified email
email_verified: Boolean!
# If the user has applied to the event
applied: Boolean!
# If the user has been accepted to the event
accepted: Boolean!
# If the user has been accepted and notified of his or her acceptance
accepted_and_notified: Boolean!
# If the user has submitted a confirmation
confirmed: Boolean!
# A users assigned confirmation branch
confirmationBranch: String
# A users application phase answers
# null if user has not filled out this phase
application: Branch
# A users confirmation phase answers
# null if user has not filled out this phase
confirmation: Branch
# Get the answer to one of the questions asked of this user.
# If branch is not given, find this question name in any branch.
question(name: String!): FormItem
# Get the answer to multiple questions asked of this user, userful
# when the set of questions you want to receive is set by the user.
questions(names: [String!]!): [FormItem!]!
# What team, if any, is the user a part of?
team: Team
# ID used for pagination
pagination_token: ID!
}
# Filter users by this criterea.
# A value means to filter by that value, no value
# means that filter will be ignored.
input UserFilter {
# If the user has applied to the event
applied: Boolean
# If the user has been accepted to the event
accepted: Boolean
# If the user has indicated that he or she is attending
confirmed: Boolean
# The type of application a user filled out (e.g. Mentor, Participant)
application_branch: String
# The type of confirmation a user filled out (e.g. Needs Reimbursement)
confirmation_branch: String
}
# A filled out form (application / confirmation form)
type Branch {
# What type of application did the user fill out (mentor, participant, etc.)
# when going through the form?
type: String!
# A key-value list of questions and answers from the confirmation application
data: [FormItem!]!
# Start of application as some RFC's date string
start_time: String
# Submit time of application as some RFC's date string
submit_time: String
}
# Application teams
type Team {
# ID of the Team
id: ID!
}
# Entries to various forms (application, confirmation, etc.)
type FormItem {
# Name of the question / form item
name: String!
# Type of form item (textbox, checkbox, phone no.)
type: String!
# Value (if just one string)
value: String
# Values (if many selections are applicable, like checkbox)
values: [String]
# File if type contains a file
file: File
}
# Uploaded file
type File {
# The original name of the uploaded file
original_name: String!
# The file's encoding
encoding: String!
# The file's mimetype
mimetype: String!
# The path to the file in S3
path: String!
# The size of the file in bytes
size: Int!
}
# Aggregated count data for a tag
type TagData {
name: String!
# Count of checked in users
count: Int!
}