/
queries.go
104 lines (99 loc) 路 2.41 KB
/
queries.go
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
package graphql
import "github.com/shurcooL/githubv4"
var ContributionsQuery struct {
User struct {
ContributionsCollection ContributionsCollection `graphql:"contributionsCollection(from: $from, to: $to)"`
} `graphql:"user(login: $user)"`
}
var YearActivityQuery struct {
User struct {
Repositories struct {
Nodes []Nodes
} `graphql:"repositories(first: $repoCount, ownerAffiliations: OWNER)"`
ContributionsCollection struct {
ContributionCalendar ContributionCalendar
} `graph:"contributionsCollection"`
} `graphql:"user(login: $user)"`
}
var UserQuery struct {
User struct {
Login string
Name string
AvatarURL string
Location string
Company string
Email string
TwitterUsername string
WebsiteURL string
Bio string
Status struct {
Emoji string
Message string
}
CreatedAt githubv4.DateTime
Followers struct {
TotalCount int
}
Following struct {
TotalCount int
}
StarredRepositories struct {
TotalCount int
}
Projects struct {
TotalCount int
}
Packages struct {
TotalCount int
}
Watching struct {
TotalCount int
} `graphql:"watching(privacy: PUBLIC)"`
Gists struct {
TotalCount int
} `graphql:"gists(privacy: PUBLIC)"`
Repositories struct {
TotalCount int
} `graphql:"repositories(privacy: PUBLIC)"`
Organizations struct {
TotalCount int
} `graphql:"organizations"`
SponsorshipsAsSponsor struct {
TotalCount int
} `graphql:"sponsorshipsAsSponsor"`
SponsorshipsAsMaintainer struct {
TotalCount int
} `graphql:"sponsorshipsAsMaintainer"`
} `graphql:"user(login: $user)"`
}
var OrganizationQuery struct {
Organization struct {
Login string
Name string
AvatarURL string
Location string
Email string
TwitterUsername string
WebsiteURL string
Description string
CreatedAt githubv4.DateTime
Projects struct {
TotalCount int
}
Packages struct {
TotalCount int
}
Repositories struct {
TotalCount int
} `graphql:"repositories(privacy: PUBLIC)"`
MembersWithRole struct {
TotalCount int
} `graphql:"membersWithRole(first: 100)"`
SponsorshipsAsSponsor struct {
TotalCount int
} `graphql:"sponsorshipsAsSponsor"`
SponsorshipsAsMaintainer struct {
TotalCount int
} `graphql:"sponsorshipsAsMaintainer"`
} `graphql:"organization(login: $user)"`
}