Describe the bug
The TypeScript definitions for GitHub of @actions/github are almost entirely wrong. They export a class with a single public method called graphql the takes an object of options.
This does not reflect the documentation or the actual library at all.
The documentation says you can do the following things:
import { GitHub } from "@actions/github"
const octokit = new github.GitHub(myToken);
octokit.pulls.get(/* ... */);
octokit.issues.create(/* ... */);
octokit.graphql(query, variables);
Instead TypeScript says the octokit only has a single method called graphql expecting a single parameter only.
To Reproduce
yarn init -y
yarn add @actions/github
touch index.ts
- open
index.ts add the following code
import { GitHub } from "@actions/github"
const x: any = null;
const octokit = new github.GitHub(x);
octokit.pulls.get(x);
octokit.issues.create(x);
octokit.graphql(x, x);
Expected behavior
TypeScript will reflect the API of the library and match the documentation
Desktop (please complete the following information):
- OS: macOS Catalina
- Browser Node.js
- Version 12 lts
Describe the bug
The TypeScript definitions for GitHub of
@actions/githubare almost entirely wrong. They export a class with a single public method calledgraphqlthe takes an object of options.This does not reflect the documentation or the actual library at all.
The documentation says you can do the following things:
Instead TypeScript says the
octokitonly has a single method calledgraphqlexpecting a single parameter only.To Reproduce
yarn init -yyarn add @actions/githubtouch index.tsindex.tsadd the following codeExpected behavior
TypeScript will reflect the API of the library and match the documentation
Desktop (please complete the following information):