Skip to content

Commit 9a9cd7b

Browse files
fixed grapql request
1 parent 63c671d commit 9a9cd7b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/apis/apis.service.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class APIService {
3434
query:
3535
'query GetUserDetails($username: String!) { user(login: $username)' +
3636
'{ name login followers { totalCount } repositories(first: 100, orderBy: {field: STARGAZERS, direction: DESC})' +
37-
'{ nodes { name owner { login } isPrivate stargazerCount } } } } }',
37+
'{ nodes { name owner { login } isPrivate stargazerCount } } } }',
3838
variables: {
3939
username: username
4040
}
@@ -45,7 +45,10 @@ export class APIService {
4545
}
4646
);
4747

48-
if (response.status !== 200) return null;
48+
if (response.status !== 200) {
49+
console.error(response.data);
50+
return null;
51+
}
4952
const data: GithubRepos = response.data;
5053

5154
data.total_stars = data?.data?.user?.repositories?.nodes?.reduce(

0 commit comments

Comments
 (0)