7
7
CustomError ,
8
8
logger ,
9
9
MissingParamError ,
10
- parseBoolean ,
11
10
request ,
12
11
wrapTextMultiline ,
13
12
} from "../common/utils.js" ;
@@ -23,7 +22,7 @@ const fetcher = (variables, token) => {
23
22
return request (
24
23
{
25
24
query : `
26
- query userInfo($login: String!, $ownerAffiliations: [RepositoryAffiliation] ) {
25
+ query userInfo($login: String!) {
27
26
user(login: $login) {
28
27
name
29
28
login
@@ -46,7 +45,7 @@ const fetcher = (variables, token) => {
46
45
followers {
47
46
totalCount
48
47
}
49
- repositories(ownerAffiliations: $ownerAffiliations ) {
48
+ repositories(ownerAffiliations: OWNER ) {
50
49
totalCount
51
50
}
52
51
}
@@ -71,9 +70,9 @@ const repositoriesFetcher = (variables, token) => {
71
70
return request (
72
71
{
73
72
query : `
74
- query userInfo($login: String!, $after: String, $ownerAffiliations: [RepositoryAffiliation] ) {
73
+ query userInfo($login: String!, $after: String) {
75
74
user(login: $login) {
76
- repositories(first: 100, ownerAffiliations: $ownerAffiliations , orderBy: {direction: DESC, field: STARGAZERS}, after: $after) {
75
+ repositories(first: 100, ownerAffiliations: OWNER , orderBy: {direction: DESC, field: STARGAZERS}, after: $after) {
77
76
nodes {
78
77
name
79
78
stargazers {
@@ -150,14 +149,7 @@ const totalStarsFetcher = async (username, repoToHide) => {
150
149
let hasNextPage = true ;
151
150
let endCursor = null ;
152
151
while ( hasNextPage ) {
153
- const variables = {
154
- login : username ,
155
- first : 100 ,
156
- after : endCursor ,
157
- ownerAffiliations : parseBoolean ( process . env . INCLUDE_ORGS )
158
- ? [ "OWNER" , "COLLABORATOR" ]
159
- : [ "OWNER" ] ,
160
- } ;
152
+ const variables = { login : username , first : 100 , after : endCursor } ;
161
153
let res = await retryer ( repositoriesFetcher , variables ) ;
162
154
163
155
if ( res . data . errors ) {
@@ -211,12 +203,7 @@ const fetchStats = async (
211
203
rank : { level : "C" , score : 0 } ,
212
204
} ;
213
205
214
- let res = await retryer ( fetcher , {
215
- login : username ,
216
- ownerAffiliations : parseBoolean ( process . env . INCLUDE_ORGS )
217
- ? [ "OWNER" , "COLLABORATOR" ]
218
- : [ "OWNER" ] ,
219
- } ) ;
206
+ let res = await retryer ( fetcher , { login : username } ) ;
220
207
221
208
// Catch GraphQL errors.
222
209
if ( res . data . errors ) {
0 commit comments