( account: Account, query: string, variables: Record<string, unknown>, )
| 43 | * @returns Resolves to a typed GitHub GraphQL response. |
| 44 | */ |
| 45 | export async function performGraphQLRequestString<TResult>( |
| 46 | account: Account, |
| 47 | query: string, |
| 48 | variables: Record<string, unknown>, |
| 49 | ): Promise<TResult> { |
| 50 | const octokit = await createOctokitClient(account, 'graphql'); |
| 51 | |
| 52 | try { |
| 53 | return await octokit.graphql<TResult>(query, variables || {}); |
| 54 | } catch (error) { |
| 55 | if (error instanceof GraphqlResponseError) { |
| 56 | handleGraphQLResponseError<TResult>('performGraphQLRequestString', error); |
| 57 | } else { |
| 58 | throw error; |
| 59 | } |
| 60 | } |
| 61 | } |
no test coverage detected