Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 65 additions & 1 deletion github.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,39 @@ extend schema
)

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(
Expand All @@ -34,7 +67,38 @@ type Query {
)
}

"A file or directory in the Git repository"
"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!
Expand Down
15 changes: 15 additions & 0 deletions router.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
supergraph:
listen: 0.0.0.0:8080
include_subgraph_errors:
all: true
cors:
allow_any_origin: true
connectors:
sources:
github.github:
$config:
token: ${env.GITHUB_API_TOKEN}
telemetry:
instrumentation:
spans:
mode: spec_compliant
6 changes: 3 additions & 3 deletions supergraph.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
federation_version: =2.10.0
subgraphs:
products:
github:
routing_url: http://ignore
schema:
file: products.graphql
federation_version: =2.10.0
file: github.graphql