@@ -12,53 +12,57 @@ import {
12
12
} from "../common/utils.js" ;
13
13
14
14
// 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
22
22
}
23
- pageInfo {
24
- hasNextPage
25
- endCursor
26
- }
27
- }` ;
23
+ }
24
+ pageInfo {
25
+ hasNextPage
26
+ endCursor
27
+ }
28
+ }
29
+ ` ;
30
+
28
31
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
+ }
32
36
}
33
- }
34
37
` ;
38
+
35
39
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 }
58
64
}
59
- ${ GRAPHQL_REPOS_STRING }
60
65
}
61
- }
62
66
` ;
63
67
64
68
/**
0 commit comments