-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
361 lines (341 loc) · 7.34 KB
/
schema.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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
enum Party {
"""
Democratic Party: https://en.wikipedia.org/wiki/Democratic_Party_(United_States)
"""
D
"""
Republican Party: https://en.wikipedia.org/wiki/Republican_Party_(United_States)
"""
R
}
"""
The chambers of the [United States Congress](https://en.wikipedia.org/wiki/United_States_Congress).
"""
enum Chamber {
HOUSE
SENATE
}
type ChamberVote {
congress: Int
session: Int
chamber: String
rollCall: Int
source: String
url: String
question: String
question_text: String
description: String
voteType: String
date: String
time: String
result: String
tieBreaker: String
tieBreakerVote: String
documentNumber: String
documentTitle: String
positions: [ChamberVotePosition]
total: ChamberVoteTotal
democratic: PartyVoteTotal
republican: PartyVoteTotal
independent: PartyVoteTotal
nomination: Nomination
bill: Bill
amendment: Amendment
}
type Amendment {
number: String
apiUri: String
sponsorId: ID
sponsor: String
sponsorUri: String
sponsorParty: Party
sponsorState: String
}
type Bill {
billId: ID
number: String
title: String
shortTitle: String
latestAction: String
details: BillDetails
}
type BillDetails {
billId: ID
billSlug: String
congress: String
bill: String
billType: String
number: String
title: String
shortTitle: String
sponsorTitle: String
sponsor: String
sponsorId: ID
# # sponsor_uri: 'https://api.propublica.org/congress/v1/members/S000148.json',
# sponsor_party: Party
# sponsor_state: String
# gpo_pdf_uri: null,
# congressdotgov_url: 'https://www.congress.gov/bill/116th-congress/senate-bill/4653',
# govtrack_url: 'https://www.govtrack.us/congress/bills/116/s4653',
# introduced_date: '2020-09-22',
# active: true,
# last_vote: '2020-10-01',
# house_passage: null,
# senate_passage: null,
# enacted: null,
# vetoed: null,
# cosponsors: 0,
# cosponsors_by_party: {},
# withdrawn_cosponsors: 0,
# primary_subject: '',
# committees: '',
# committee_codes: [],
# subcommittee_codes: [],
# latest_major_action_date: '2020-10-01',
# latest_major_action: 'Cloture on the motion to proceed to the measure not invoked in Senate by Yea-Nay Vote. 51 - 43. Record Vote Number: 200. (CR S6015)',
# house_passage_vote: null,
# senate_passage_vote: null,
# summary: '',
# summary_short: '',
# cbo_estimate_url: null,
# versions: [Array],
# actions: [Array],
# presidential_statements: [],
# votes: [Array]
}
type Nomination {
nominationId: ID
number: String
name: String
agency: String
}
type PartyVoteTotal {
yes: Int
no: Int
present: Int
notVoting: Int
majorityPosition: String
}
type ChamberVoteTotal {
yes: Int
no: Int
present: Int
notVoting: Int
}
type ChamberVotePosition {
memberId: ID
name: String
party: Party
state: String
votePosition: String
dwNominate: Float
}
type MemberVote {
memberId: ID
chamber: String
congress: String
session: String
rollCall: String
vote: ChamberVote
bill: BillForVote
description: String
question: String
result: String
date: String
time: String
total: MemberVoteTotal
position: String
}
type BillForVote {
billId: ID
number: String
billUrl: String
title: String
latestAction: String
}
type MemberVoteTotal {
yes: Int
no: Int
present: Int
notVoting: Int
}
"""
Interface to abstract the shared data returned from the congress members list
and the individual members detail endpoint.
"""
interface Member {
id: ID
firstName: String
middleName: String
lastName: String
suffix: String
dateOfBirth: String
gender: String
twitterAccount: String
facebookAccount: String
youtubeAccount: String
votesmartId: ID
inOffice: Boolean
lastUpdated: String
url: String
rssUrl: String
icpsrId: ID
crpId: ID
googleEntityId: ID
cspanId: ID
govtrackId: ID
# extended
# totalVotes: Int
}
"""
Metadata for each member of the United States Congress, provided by ProPublica.
Fetched through https://api.propublica.org/congress/v1/members/${MEMBER_ID}.json
"""
type MemberDetails implements Member {
# copied from Member Interface
id: ID
firstName: String
middleName: String
lastName: String
suffix: String
dateOfBirth: String
gender: String
twitterAccount: String
facebookAccount: String
youtubeAccount: String
votesmartId: ID
inOffice: Boolean
lastUpdated: String
url: String
rssUrl: String
icpsrId: ID
crpId: ID
googleEntityId: ID
cspanId: ID
govtrackId: ID
# fields only available by requesting data from individual member endpoint
roles: [MemberDetailsRole]
mostRecentVote: String
currentParty: Party
timesTopicsUrl: String
timesTag: String
votes(offset: Int = 0): [MemberVote]
}
"""
Details for each role a member in congress might have, fetched through the member
details endpoint: https://api.propublica.org/congress/v1/members/${MEMBER_ID}.json
"""
type MemberDetailsRole {
congress: String
chamber: String
title: String
shortTitle: String
state: String
party: Party
leadershipRole: String
fecCandidateId: ID
seniority: String
senateClass: String
stateRank: String
lisId: ID
ocdId: ID
startDate: String
endDate: String
office: String
phone: String
fax: String
contactForm: String
cookPvi: String
dwNominate: String
idealPoint: Float
nextElection: String
totalVotes: Int
missedVotes: Int
totalPresent: Int
billsSponsored: Int
billsCosponsored: Int
missedVotesPct: Float
votesWithPartyPct: Float
votesAgainstPartyPct: Float
# committees: [ [Object], [Object], [Object], [Object], [Object] ],
# subcommittees: []
}
"""
Metadata for each member of the United States Congress, as it pertains to each session of congress.
Fetched through https://api.propublica.org/congress/v1/{congress}/{chamber}/members.json.
"""
type CongressMember implements Member {
# copied from Member Interface
id: ID
firstName: String
middleName: String
lastName: String
suffix: String
dateOfBirth: String
gender: String
twitterAccount: String
facebookAccount: String
youtubeAccount: String
votesmartId: ID
inOffice: Boolean
lastUpdated: String
url: String
rssUrl: String
icpsrId: ID
crpId: ID
googleEntityId: ID
cspanId: ID
govtrackId: ID
# fields extended by CongressMember
title: String
shortTitle: String
apiUri: String
party: Party
leadershipRole: String
fecCandidateId: ID
contactForm: String
dwNominate: Float
seniority: String
nextElection: String
totalVotes: Int
missedVotes: Int
totalPresent: Int
ocdId: ID
office: String
phone: String
fax: String
state: String
senateClass: String
stateRank: String
lisId: ID
missedVotesPct: Float
votesWithPartyPct: Float
votesAgainstPartyPct: Float
cookPvi: String
idealPoint: Float
}
type Congress {
congress: String
chamber: String
numResults: Int
offset: Int
members: [CongressMember]
}
"""
A GraphQL interface for congressional data exposed by ProPublica: https://projects.propublica.org/api-docs/congress-api/.
Congressional data is updated daily.
Fetch an API Key from them for free: https://www.propublica.org/datastore/api/propublica-congress-api
"""
type Query {
congress(
"""
Specifies which session of Congress, e.g. 116
"""
congress: Int!
"""
Specifies which chamber of Congress, HOUSE or SENATE
"""
chamber: Chamber!
): [Congress]
memberById(id: ID!): MemberDetails
}