-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgithub.graphql
More file actions
107 lines (100 loc) · 2.15 KB
/
github.graphql
File metadata and controls
107 lines (100 loc) · 2.15 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
extend schema
@link(url: "https://specs.apollo.dev/federation/v2.11", import: ["@key"])
@link(
url: "https://specs.apollo.dev/connect/v0.2"
import: ["@connect", "@source"]
)
@source(
name: "github"
http: {
baseURL: "https://api.github.com"
headers: [
{ name: "Accept", value: "application/vnd.github+json" }
{ name: "User-Agent", value: "{$config.agent}" }
{ name: "Authorization", value: "token {$config.token}" }
]
}
)
type Query {
"All teams in the DaleStudy organization"
teams: [Team]!
@connect(
source: "github"
# https://docs.github.com/en/rest/teams/teams#list-teams
http: { GET: "/orgs/DaleStudy/teams" }
selection: """
id
name
description
members {
login
id
}
"""
)
"All members of a team in the DaleStudy organization"
members(teamName: String!): [Member]!
@connect(
source: "github"
# https://docs.github.com/en/rest/teams/members#list-team-members
http: {
GET: "/orgs/DaleStudy/teams/{$args.teamName}/members?per_page=100"
}
selection: """
login
id
avatarUrl: avatar_url
"""
)
"All trees in the leetcode-study repository"
gitTrees: [GitTree]!
@connect(
source: "github"
# https://docs.github.com/en/rest/git/trees#get-a-tree
http: {
GET: "/repos/DaleStudy/leetcode-study/git/trees/main?recursive=1"
}
selection: """
$.tree {
type
path
}
"""
)
}
"A team"
type Team {
"The unique identifier"
id: ID!
"The name"
name: String!
"The description"
description: String
"The members"
members: [Member]!
@connect(
source: "github"
http: { GET: "/orgs/DaleStudy/teams/{$this.name}/members?per_page=100" }
selection: """
login
id
avatarUrl: avatar_url
"""
)
}
"A member"
type Member {
"The unique identifier"
id: ID!
"The login name"
login: String!
"The avatar URL"
avatarUrl: String!
}
"A Git tree"
type GitTree {
"The type of the node"
type: String!
"The path of the node"
path: String!
}