Skip to content

Commit eceab86

Browse files
anuraghazrarickstaa
authored andcommitted
lol happy new year
1 parent cf33c65 commit eceab86

File tree

1 file changed

+44
-40
lines changed

1 file changed

+44
-40
lines changed

src/fetchers/stats-fetcher.js

+44-40
Original file line numberDiff line numberDiff line change
@@ -12,53 +12,57 @@ import {
1212
} from "../common/utils.js";
1313

1414
// GraphQL queries.
15-
const GRAPHQL_REPOS_STRING = `repositories(first: 100, ownerAffiliations: OWNER, orderBy: {direction: DESC, field: STARGAZERS}, after: $after) {
16-
totalCount
17-
nodes {
18-
name
19-
stargazers {
20-
totalCount
21-
}
15+
const GRAPHQL_REPOS_FIELD = `
16+
repositories(first: 100, ownerAffiliations: OWNER, orderBy: {direction: DESC, field: STARGAZERS}, after: $after) {
17+
totalCount
18+
nodes {
19+
name
20+
stargazers {
21+
totalCount
2222
}
23-
pageInfo {
24-
hasNextPage
25-
endCursor
26-
}
27-
}`;
23+
}
24+
pageInfo {
25+
hasNextPage
26+
endCursor
27+
}
28+
}
29+
`;
30+
2831
const GRAPHQL_REPOS_QUERY = `
29-
query userInfo($login: String!, $after: String) {
30-
user(login: $login) {
31-
${GRAPHQL_REPOS_STRING}
32+
query userInfo($login: String!, $after: String) {
33+
user(login: $login) {
34+
${GRAPHQL_REPOS_FIELD}
35+
}
3236
}
33-
}
3437
`;
38+
3539
const GRAPHQL_STATS_QUERY = `
36-
query userInfo($login: String!, $after: String) {
37-
user(login: $login) {
38-
name
39-
login
40-
contributionsCollection {
41-
totalCommitContributions
42-
restrictedContributionsCount
43-
}
44-
repositoriesContributedTo(first: 1, contributionTypes: [COMMIT, ISSUE, PULL_REQUEST, REPOSITORY]) {
45-
totalCount
46-
}
47-
pullRequests(first: 1) {
48-
totalCount
49-
}
50-
openIssues: issues(states: OPEN) {
51-
totalCount
52-
}
53-
closedIssues: issues(states: CLOSED) {
54-
totalCount
55-
}
56-
followers {
57-
totalCount
40+
query userInfo($login: String!, $after: String) {
41+
user(login: $login) {
42+
name
43+
login
44+
contributionsCollection {
45+
totalCommitContributions
46+
restrictedContributionsCount
47+
}
48+
repositoriesContributedTo(first: 1, contributionTypes: [COMMIT, ISSUE, PULL_REQUEST, REPOSITORY]) {
49+
totalCount
50+
}
51+
pullRequests(first: 1) {
52+
totalCount
53+
}
54+
openIssues: issues(states: OPEN) {
55+
totalCount
56+
}
57+
closedIssues: issues(states: CLOSED) {
58+
totalCount
59+
}
60+
followers {
61+
totalCount
62+
}
63+
${GRAPHQL_REPOS_FIELD}
5864
}
59-
${GRAPHQL_REPOS_STRING}
6065
}
61-
}
6266
`;
6367

6468
/**

0 commit comments

Comments
 (0)