MCPcopy Index your code
hub / github.com/anomalyco/opencode / graphql

Function graphql

script/github/close-prs.ts:246–256  ·  view source on GitHub ↗
(input: { query: string; variables: Record<string, string | null> })

Source from the content-addressed store, hash-verified

244}
245
246async function graphql(input: { query: string; variables: Record<string, string | null> }) {
247 const response = await githubRequest("/graphql", {
248 method: "POST",
249 body: JSON.stringify(input),
250 })
251 const body = (await response.json()) as GraphqlResponse
252 if (body.errors?.length)
253 throw new Error(`GitHub GraphQL error: ${body.errors.map((error) => error.message).join(", ")}`)
254 if (!body.data) throw new Error("GitHub GraphQL response did not include data")
255 return body.data
256}
257
258async function closePullRequest(pr: CleanupCandidate) {
259 await githubRequest(`/repos/${repo.owner}/${repo.name}/issues/${pr.number}/comments`, {

Callers 1

fetchOpenPullRequestsFunction · 0.85

Calls 2

githubRequestFunction · 0.85
jsonMethod · 0.65

Tested by

no test coverage detected