-
Notifications
You must be signed in to change notification settings - Fork 10
/
schemaV1.graphql
4341 lines (3780 loc) · 92.5 KB
/
schemaV1.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
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
"""
Input type for Application
"""
input ApplicationInput {
type: ApplicationType!
name: String
description: String
callbackUrl: String
}
"""
All application types
"""
enum ApplicationType {
API_KEY
OAUTH
}
"""
Application model
"""
type Application {
id: Int
type: ApplicationType
name: String
description: String
apiKey: String
clientId: String
clientSecret: String
callbackUrl: String
}
"""
Collective interface
"""
interface CollectiveInterface {
id: Int
createdByUser: UserDetails
parentCollective: CollectiveInterface
children: [CollectiveInterface]!
type: String
isActive: Boolean
name: String
legalName: String
company: String
description: String
longDescription: String
expensePolicy: String
tags: [String]
"""
Name, address, country, lat, long of the location.
"""
location: LocationType
createdAt: DateString
startsAt: DateString
endsAt: DateString
timezone: String
hostFeePercent: Float
platformFeePercent: Int
currency: String
image: String
imageUrl(height: Int, format: ImageFormat): String
backgroundImage: String
backgroundImageUrl(height: Int, format: ImageFormat): String
settings: JSON!
"""
Defines if a collective is pledged
"""
isPledged: Boolean
data: JSON @deprecated(reason: "2020-10-08: This field is not provided anymore and will return an empty object")
"""
Private instructions related to an event
"""
privateInstructions: String
githubContributors: JSON!
slug: String
path: String
isHost: Boolean
isIncognito: Boolean
"""
Whether this account is frozen
"""
isFrozen: Boolean!
isGuest: Boolean
canApply: Boolean
canContact: Boolean
isArchived: Boolean
isApproved: Boolean
isDeletable: Boolean
host: CollectiveInterface
hostCollective: CollectiveInterface
"""
List of all collectives that are related to this collective with their membership relationship. Can filter by role (BACKER/MEMBER/ADMIN/HOST/FOLLOWER)
"""
members(
limit: Int
offset: Int
"""
Type of User: USER/ORGANIZATION
"""
type: String
TierId: Int
tierSlug: String
role: String
roles: [String]
): [Member]
"""
List of all collectives that this collective is a member of with their membership relationship. Can filter by role (BACKER/MEMBER/ADMIN/HOST/FOLLOWER)
"""
memberOf(
limit: Int
offset: Int
"""
Type of collective (COLLECTIVE, EVENT, ORGANIZATION)
"""
type: String
role: String
roles: [String]
"""
Only return memberships for active collectives (that have been approved by the host)
"""
onlyActiveCollectives: Boolean = false
"""
Whether incognito profiles should be included in the result. Only works if requesting user is an admin of the account.
"""
includeIncognito: Boolean = true
): [Member]
"""
All the persons and entities that contribute to this organization
"""
contributors(limit: Int = 1000, roles: [ContributorRole]): [Contributor]
"""
List of all collectives hosted by this collective
"""
collectives(
orderBy: CollectiveOrderField = name
orderDirection: OrderDirection = ASC
expenseStatus: String = null
limit: Int
offset: Int
isActive: Boolean
isArchived: Boolean
): CollectiveSearchResults
"""
List of all followers of this collective
"""
followers(limit: Int, offset: Int): [CollectiveInterface]
"""
List of all notifications for this collective
"""
notifications(limit: Int, offset: Int, channel: String, type: String, active: Boolean): [NotificationType]
tiers(id: Int, slug: String, slugs: [String]): [Tier]
orders(status: OrderStatus): [OrderType]
ordersFromCollective(subscriptionsOnly: Boolean): [OrderType]
stats: CollectiveStatsType
transactions(type: String, limit: Int, offset: Int, includeExpenseTransactions: Boolean): [Transaction]
expenses(type: String, limit: Int, offset: Int, status: String, includeHostedCollectives: Boolean): [ExpenseType]
"""
The list of expense types supported by this account
"""
supportedExpenseTypes: [String!]!
role: String
twitterHandle: String
githubHandle: String @deprecated(reason: "2022-06-03: Please use repositoryUrl")
repositoryUrl: String
website: String
updates(limit: Int, offset: Int, onlyPublishedUpdates: Boolean): [UpdateType]
@deprecated(reason: "2022-09-09: Updates moved to GQLV2")
events(
limit: Int
offset: Int
"""
Include past events
"""
includePastEvents: Boolean = false
"""
Include inactive events
"""
includeInactive: Boolean = false
): [Event]
projects(limit: Int, offset: Int): [Project]
paymentMethods(
service: String
limit: Int
hasBalanceAboveZero: Boolean
"""
Only return confirmed payment methods
"""
isConfirmed: Boolean = true
"""
Filter on given types (creditcard, giftcard, etc.)
"""
type: [String]
"""
Order entries based on given column. Set to null for no ordering.
"""
orderBy: PaymenMethodOrderField
"""
Defines if the host "collective" payment method should be returned
"""
includeHostCollectivePaymentMethod: Boolean = false
): [PaymentMethodType]
"""
The list of payout methods that this collective can use to get paid
"""
payoutMethods: [PayoutMethod]
"""
List all the gift cards batches emitted by this collective. May include `null` as key for unbatched gift cards.
"""
giftCardsBatches: [PaymentMethodBatchInfo]
createdGiftCards(
limit: Int
offset: Int
batch: String
"""
Whether the gift card has been claimed or not
"""
isConfirmed: Boolean
): PaginatedPaymentMethod
connectedAccounts: [ConnectedAccountType]
"""
Describes the features enabled and available for this collective
"""
features: CollectiveFeatures!
plan: PlanType
contributionPolicy: String
"""
Categories set by Open Collective to help moderation.
"""
categories: [String]!
"""
Policies for the account. To see non-public policies you need to be admin and have the scope: "account".
"""
policies: Policies!
}
"""
This represents the details of a User
"""
type UserDetails {
id: Int
CollectiveId: Int
collective: CollectiveInterface
username: String @deprecated(reason: "2022-01-13: Not used anymore. Will be ignored")
name: String @deprecated(reason: "2022-06-02: Please use collective.name")
image: String
email: String
emailWaitingForValidation: String
memberOf(
roles: [String]
"""
Whether incognito profiles should be included in the result. Only works if requesting user is an admin of the account.
"""
includeIncognito: Boolean = true
): [Member]
"""
Returns true if user account is limited (user can't use any feature)
"""
isLimited: Boolean
hasSeenLatestChangelogEntry: Boolean!
}
"""
This is a Member
"""
type Member {
id: Int
createdAt: DateString
orders(limit: Int, offset: Int): [OrderType]
transactions(limit: Int, offset: Int): [Transaction]
collective: CollectiveInterface
member: CollectiveInterface
role: String
description: String
"""
Custom user message from member to the collective
"""
publicMessage: String
tier: Tier
stats: StatsMemberType
since: DateString
}
scalar DateString
"""
This is an order (for donations, buying tickets, subscribing to a Tier, pledging to a Collective)
"""
type OrderType {
id: Int
idV2: String
"""
quantity of items (defined by Tier)
"""
quantity: Int
"""
total amount for this order (doesn't include recurring transactions)
"""
totalAmount: Int
"""
The amount paid in tax (for example VAT) for this order
"""
taxAmount: Int
"""
frequency of the subscription if any (could be either null, 'month' or 'year')
"""
interval: String
subscription: Subscription
stats: StatsOrderType
createdByUser: UserDetails
"""
Description of the order that will show up in the invoice
"""
description: String
"""
Custom user message to show with the order, e.g. a special dedication, "in memory of", or to add a custom one liner when RSVP for an event
"""
publicMessage: String
"""
Private message for the admins and the host of the collective
"""
privateMessage: String
"""
Collective ordering (most of the time it will be the collective of the createdByUser)
"""
fromCollective: CollectiveInterface
"""
Collective that receives the order
"""
collective: CollectiveInterface
tier: Tier
"""
Payment method used to pay for the order. The paymentMethod is also attached to individual transactions since a credit card can change over the lifetime of a subscription.
"""
paymentMethod: PaymentMethodType
"""
transactions for this order ordered by createdAt DESC
"""
transactions(
limit: Int
offset: Int
"""
type of transaction (DEBIT/CREDIT)
"""
type: String
): [Transaction]
currency: String
createdAt: DateString
updatedAt: DateString
"""
Whether this subscription is past due or not
"""
isPastDue: Boolean
"""
If there is a subscription, is it active?
"""
isSubscriptionActive: Boolean
"""
Current status for an order
"""
status: OrderStatus
"""
Additional information on order: tax and custom fields
"""
data: JSON
stripeError: StripeError
}
"""
Subscription model
"""
type Subscription {
id: Int
amount: Int
currency: String
interval: String
stripeSubscriptionId: String
isActive: Boolean
}
"""
Stats about an order
"""
type StatsOrderType {
id: Int
"""
number of transactions for this order (includes past recurring transactions)
"""
transactions: Int
"""
total amount of all the transactions for this order (includes past recurring transactions)
"""
totalTransactions: Int
}
"""
This represents an Tier
"""
type Tier {
id: Int
slug: String
type: String
name: String
description: String
"""
A long, html-formatted description.
"""
longDescription: String
"""
Returns true if the tier has its standalone page activated
"""
useStandalonePage: Boolean
"""
Link to a video (YouTube, Vimeo).
"""
videoUrl: String
button: String
amount: Int
minimumAmount: Int
amountType: String
currency: String
interval: String
presets: [Int]
maxQuantity: Int
goal: Int
customFields: [JSON]
startsAt: DateString
endsAt: DateString
collective: CollectiveInterface
event: CollectiveInterface
orders(
isActive: Boolean
"""
only return orders that have been processed (fulfilled)
"""
isProcessed: Boolean
limit: Int
): [OrderType]
"""
Returns a list of all the contributors for this tier
"""
contributors(
"""
Maximum number of entries to return
"""
limit: Int = 3000
): [Contributor]
stats: TierStatsType
data: JSON
}
"""
The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).
"""
scalar JSON
"\n A person or an entity that contributes financially or by any other mean to the mission\n of the collective. While \"Member\" is dedicated to permissions, this type is meant\n to surface all the public contributors.\n "
type Contributor {
"""
A unique identifier for this member
"""
id: String!
"""
Name of the contributor
"""
name: String!
"""
All the roles for a given contributor
"""
roles: [ContributorRole]
"""
True if the contributor is a collective admin
"""
isAdmin: Boolean!
"""
True if the contributor is a core contributor
"""
isCore: Boolean!
"""
True if the contributor is a financial contributor
"""
isBacker: Boolean!
"""
True if the contributor is a fundraiser
"""
isFundraiser: Boolean!
"""
A list of tier ids that this contributors is a member of. A null value indicates that a membership without tier.
"""
tiersIds: [Int]!
"""
Member join date
"""
since: IsoDateString!
"""
How much money the user has contributed for this (in cents, using collective currency)
"""
totalAmountDonated: Int!
"""
Whether the contributor is an individual, an organization...
"""
type: String!
"""
Defines if the contributors wants to be incognito (name not displayed)
"""
isIncognito: Boolean!
"""
Defines if the contributors is a guest account
"""
isGuest: Boolean!
"""
Description of how the member contribute. Will usually be a tier name, or "design" or "code".
"""
description: String
"""
If the contributor has a page on Open Collective, this is the slug to link to it
"""
collectiveSlug: String
"""
Null for incognito collectives otherwise collective id
"""
collectiveId: Int
"""
Contributor avatar or logo
"""
image(height: Int, format: ImageFormat): String
"""
A public message from contributors to describe their contributions
"""
publicMessage: String
}
"""
Possible roles for a contributor. Extends `Member.Role`.
"""
enum ContributorRole {
HOST
ADMIN
MEMBER
CONTRIBUTOR
BACKER
FUNDRAISER
ATTENDEE
FOLLOWER
CONNECTED_COLLECTIVE
ACCOUNTANT
}
scalar IsoDateString
enum ImageFormat {
txt
png
jpg
gif
svg
}
"""
Stats about a tier
"""
type TierStatsType {
id: Int
"""
Breakdown of all the contributors that belongs to this tier.
"""
contributors: ContributorsStats
"""
total number of individual orders
"""
totalOrders: Int
"""
Total amount donated for this tier, in cents.
"""
totalDonated: Int
"""
How much money is given for this tier for each tier.interval (monthly/yearly). For flexible tiers, this amount is a monthly average of contributions amount, taking into account both yearly and monthly subscriptions.
"""
totalRecurringDonations: Int
"""
total number of people/organizations in this tier
"""
totalDistinctOrders: Int
"""
total number of active people/organizations in this tier
"""
totalActiveDistinctOrders: Int
availableQuantity: Int
}
"""
Breakdown of contributors per type (ANY/USER/ORGANIZATION/COLLECTIVE)
"""
type ContributorsStats {
"""
We always have to return an id for apollo's caching
"""
id: String!
"""
Total number of contributors
"""
all: Int
"""
Number of individuals
"""
users: Int
"""
Number of organizations
"""
organizations: Int
"""
Number of collectives
"""
collectives: Int
}
"""
Sanitized PaymentMethod Info (PaymentMethod model)
"""
type PaymentMethodType {
id: Int
uuid: String
createdAt: DateString
"""
Will be true for gift card if claimed. Always true for other payment methods.
"""
isConfirmed: Boolean
expiryDate: DateString
service: String
"""
To group multiple payment methods. Used for Gift Cards
"""
batch: String
type: String
data: JSON
name: String
description: String
primary: Boolean
monthlyLimitPerMember: Int
initialBalance: Int
"""
Returns the balance in the currency of this paymentMethod
"""
balance: Int
collective: CollectiveInterface
emitter: CollectiveInterface
limitedToTags: JSON
limitedToHostCollectiveIds: [Int]
orders(
"""
Only returns orders that have an active subscription (monthly/yearly)
"""
hasActiveSubscription: Boolean
): [OrderType]
"""
Get the list of collectives that used this payment method. Useful to select the list of a backers for which the host has manually added funds.
"""
fromCollectives(limit: Int, offset: Int): CollectiveSearchResults
currency: String
stripeError: StripeError
}
type StripeError {
message: String
account: String
response: JSON
}
"""
Possible statuses for an Order
"""
enum OrderStatus {
NEW
REQUIRE_CLIENT_CONFIRMATION
PAID
ERROR
ACTIVE
CANCELLED
PENDING
EXPIRED
PLEDGED
REJECTED
DISPUTED
REFUNDED
IN_REVIEW
}
"""
Stats about a membership
"""
type StatsMemberType {
id: Int
"""
total amount donated directly by this member
"""
directDonations: Int
"""
total amount donated by this member either directly or using a gift card it has emitted
"""
totalDonations: Int
}
"""
Type for Location
"""
type LocationType {
"""
Unique identifier for this location
"""
id: String
"""
A short name for the location (eg. Google Headquarters)
"""
name: String
"""
Postal address without country (eg. 12 opensource avenue, 7500 Paris)
"""
address: String
"""
Two letters country code (eg. FR, BE...etc)
"""
country: String
"""
Latitude
"""
lat: Float
"""
Longitude
"""
long: Float
"""
Structured JSON address
"""
structured: JSON
}
"""
Properties by which collectives can be ordered.
"""
enum CollectiveOrderField {
"""
Order collectives by their average monthly spending (based on last 90 days)
"""
monthlySpending
"""
Order collectives by total balance.
"""
balance
"""
Order collectives by creation time.
"""
createdAt
"""
Order collectives by name.
"""
name
"""
Order collectives by slug.
"""
slug
"""
Order collectives by updated time.
"""
updatedAt
"""
Order collectives by total donations.
"""
totalDonations
"""
Order collectives by number of financial contributors (unique members).
"""
financialContributors
}
"""
Possible directions in which to order a list of items when provided an orderBy argument.
"""
enum OrderDirection {
ASC
DESC
}
"""
This represents a Notification
"""
type NotificationType {
id: Int
"""
channel to send notification
"""
channel: String
"""
the notification type
"""
type: String
"""
whether or not the notification is active
"""
active: Boolean
webhookUrl: String
user: UserDetails
collective: CollectiveInterface
createdAt: DateString
updatedAt: DateString
}
"""
This represents an Expense
"""
type ExpenseType {
id: Int
idV2: String
amount: Int
currency: String
createdAt: DateString
updatedAt: DateString
incurredAt: DateString
description: String
tags: [String]
status: String
type: String
PayoutMethod: PayoutMethod
privateMessage: String
items: [ExpenseItem]
attachedFiles: [ExpenseAttachedFile!]
user: UserDetails
fromCollective: CollectiveInterface
collective: CollectiveInterface
"""
Returns the DEBIT transaction to pay out this expense
"""
transaction: Transaction
}
"""
A payout method for expenses
"""
type PayoutMethod {
id: Int
type: PayoutMethodTypeEnum
name: String
isSaved: Boolean
data: JSON
}
enum PayoutMethodTypeEnum {
OTHER
PAYPAL
BANK_ACCOUNT
ACCOUNT_BALANCE
CREDIT_CARD
}
"""
Public fields for an expense item
"""
type ExpenseItem {
id: Int!
amount: Int!
createdAt: IsoDateString!
updatedAt: IsoDateString!
incurredAt: IsoDateString!
deletedAt: IsoDateString
description: String
url: String
}
"""
Fields for an expense's attached file
"""
type ExpenseAttachedFile {
"""
Unique identifier for this file
"""
id: Int!
url: String
}
"""
This represents an Update
"""
type UpdateType {
id: Int
views: Int
slug: String
image: String
isPrivate: Boolean
isChangelog: Boolean!
notificationAudience: UpdateAudienceTypeEnum
makePublicOn: IsoDateString
"""
Indicates whether or not the user is allowed to see the content of this update
"""
userCanSeeUpdate: Boolean
title: String
createdAt: DateString