diff --git a/README.md b/README.md index 2b74bb1..b431256 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,8 @@ const { data: pullRequest } = await octokit.pulls.get({ console.log(pullRequest); ``` +You can pass client options (except `auth`, which is handled by the token argument), as specified by [Octokit](https://octokit.github.io/rest.js/), as a second argument to the `GitHub` constructor. + You can also make GraphQL requests. See https://github.com/octokit/graphql.js for the API. ```js diff --git a/src/github.ts b/src/github.ts index 5c85e40..35b5f62 100644 --- a/src/github.ts +++ b/src/github.ts @@ -14,8 +14,8 @@ export class GitHub extends Octokit { variables?: Variables ) => Promise - constructor(token: string) { - super({auth: `token ${token}`}) + constructor(token: string, opts: Omit = {}) { + super({...opts, auth: `token ${token}`}) this.graphql = defaults({ headers: {authorization: `token ${token}`} })