MCPcopy
hub / github.com/gitify-app/gitify / performGraphQLRequest

Function performGraphQLRequest

src/renderer/utils/api/request.ts:17–33  ·  view source on GitHub ↗
(
  account: Account,
  query: TypedDocumentString<TResult, TVariables>,
  variables: TVariables,
)

Source from the content-addressed store, hash-verified

15 * @returns Resolves to a typed GitHub GraphQL response.
16 */
17export async function performGraphQLRequest<TResult, TVariables>(
18 account: Account,
19 query: TypedDocumentString<TResult, TVariables>,
20 variables: TVariables,
21): Promise<TResult> {
22 const octokit = await createOctokitClient(account, 'graphql');
23
24 try {
25 return await octokit.graphql<TResult>(query.toString(), variables || {});
26 } catch (error) {
27 if (error instanceof GraphqlResponseError) {
28 handleGraphQLResponseError<TResult>('performGraphQLRequest', error);
29 } else {
30 throw error;
31 }
32 }
33}
34
35/**
36 * Perform a GraphQL API request using a raw query string instead of a TypedDocumentString.

Callers 4

request.test.tsFile · 0.90
fetchDiscussionByNumberFunction · 0.90
fetchIssueByNumberFunction · 0.90
fetchPullByNumberFunction · 0.90

Calls 3

createOctokitClientFunction · 0.90
toStringMethod · 0.80

Tested by

no test coverage detected