-
Notifications
You must be signed in to change notification settings - Fork 0
/
github-graphql.queries.js
59 lines (57 loc) · 1.08 KB
/
github-graphql.queries.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import gql from 'graphql-tag'
const queries = {
// All github queries used in our app
// fetch github user Profile
fetchUser: gql `
query fetchUser($login: String!){
user(login: $login) {
name
bio
avatarUrl
followers {
totalCount
}
starredRepositories {
totalCount
}
following{
totalCount
}
repositories{
totalCount
}
}
}`,
// fetch github Organization Profile
fetchOrg: gql `
query fetchOrg($login: String!){
organization(login:$login){
name
repositories{
totalCount
}
description
members{
totalCount
}
}
}`,
// fetches all repos matching search text
fetchRepos: gql`
query fetchRepos($query: String!) {
search(type: REPOSITORY, query: $query, first: 100) {
edges {
node {
... on Repository {
nameWithOwner
owner {
login
__typename
}
}
}
}
}
}`
}
export default queries