Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
delete-package-versions/src/version/graphql.ts
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
19 lines (18 sloc)
741 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {GitHub} from '@actions/github' | |
import {GraphQlQueryResponseData} from '@octokit/graphql/dist-types/types' | |
import {RequestParameters} from '@octokit/types/dist-types/RequestParameters' | |
/** | |
* Sends a GraphQL query request based on endpoint options | |
* | |
* @param {string} token Auth token | |
* @param {string} query GraphQL query. Example: `'query { viewer { login } }'`. | |
* @param {object} parameters URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`. | |
*/ | |
export async function graphql( | |
token: string, | |
query: string, | |
parameters: RequestParameters | |
): Promise<GraphQlQueryResponseData> { | |
const github = new GitHub(token) | |
return await github.graphql(query, parameters) | |
} |