77 CustomError ,
88 logger ,
99 MissingParamError ,
10- parseBoolean ,
1110 request ,
1211 wrapTextMultiline ,
1312} from "../common/utils.js" ;
@@ -23,7 +22,7 @@ const fetcher = (variables, token) => {
2322 return request (
2423 {
2524 query : `
26- query userInfo($login: String!, $ownerAffiliations: [RepositoryAffiliation] ) {
25+ query userInfo($login: String!) {
2726 user(login: $login) {
2827 name
2928 login
@@ -46,7 +45,7 @@ const fetcher = (variables, token) => {
4645 followers {
4746 totalCount
4847 }
49- repositories(ownerAffiliations: $ownerAffiliations ) {
48+ repositories(ownerAffiliations: OWNER ) {
5049 totalCount
5150 }
5251 }
@@ -71,9 +70,9 @@ const repositoriesFetcher = (variables, token) => {
7170 return request (
7271 {
7372 query : `
74- query userInfo($login: String!, $after: String, $ownerAffiliations: [RepositoryAffiliation] ) {
73+ query userInfo($login: String!, $after: String) {
7574 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) {
7776 nodes {
7877 name
7978 stargazers {
@@ -150,14 +149,7 @@ const totalStarsFetcher = async (username, repoToHide) => {
150149 let hasNextPage = true ;
151150 let endCursor = null ;
152151 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 } ;
161153 let res = await retryer ( repositoriesFetcher , variables ) ;
162154
163155 if ( res . data . errors ) {
@@ -211,12 +203,7 @@ const fetchStats = async (
211203 rank : { level : "C" , score : 0 } ,
212204 } ;
213205
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 } ) ;
220207
221208 // Catch GraphQL errors.
222209 if ( res . data . errors ) {
0 commit comments