MCPcopy Index your code
hub / github.com/sourcebot-dev/sourcebot / linearGraphQL

Function linearGraphQL

scripts/tagLinearIssuesWithRelease.mjs:28–50  ·  view source on GitHub ↗
(query, variables = {})

Source from the content-addressed store, hash-verified

26const GITHUB_REPO = "sourcebot-dev/sourcebot";
27
28async function linearGraphQL(query, variables = {}) {
29 const apiKey = process.env.LINEAR_API_KEY;
30 if (!apiKey) {
31 throw new Error("LINEAR_API_KEY environment variable is required");
32 }
33
34 const response = await fetch(LINEAR_API_URL, {
35 method: "POST",
36 headers: {
37 "Content-Type": "application/json",
38 Authorization: apiKey,
39 },
40 body: JSON.stringify({ query, variables }),
41 });
42
43 const result = await response.json();
44
45 if (result.errors) {
46 throw new Error(`Linear API error: ${JSON.stringify(result.errors)}`);
47 }
48
49 return result.data;
50}
51
52/**
53 * Parse the changelog to extract PR numbers for a specific version

Callers 4

findLinearIssuesForPRsFunction · 0.85
getTeamIdFunction · 0.85
findOrCreateReleaseLabelFunction · 0.85
addLabelToIssueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected