We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
What’s missing?
An easy to use type of the extension to octokit this plugin provides.
Why?
We are passing an octokit instance as constructor parameter. To benefit of typing we want to set the type properly.
Alternatives you tried
We copied the type from the index.d.ts to build this workaround.
index.d.ts
/** * from node_modules/@octokit/plugin-paginate-graphql/dist-types/index.d.ts */ export type GraphqlPaginationExtension = { graphql: import("@octokit/graphql/dist-types/types").graphql & { paginate: (<ResponseType_1 extends object = any>(query: string, initialParameters?: Record<string, any>) => Promise<ResponseType_1>) & { iterator: <ResponseType_2 = any>(query: string, initialParameters?: Record<string, any>) => { [Symbol.asyncIterator]: () => { next(): Promise<{ done: boolean; value: ResponseType_2; }>; }; }; }; }; }
constructor( private readonly octokit: Octokit & GraphqlPaginationExtension, private readonly otherStuff: OtherStuff, ) { }
The text was updated successfully, but these errors were encountered:
Thank you for this!
Sorry, something went wrong.
You can do the following to get the returned interface type:
import { paginateGraphQL } from "@octokit/paginate-graphql"; import { Octokit } from "@octokit/core"; type PaginateGraphQLOctokit = Octokit & ReturnType<paginateGraphQL>;
No branches or pull requests
What’s missing?
An easy to use type of the extension to octokit this plugin provides.
Why?
We are passing an octokit instance as constructor parameter.
To benefit of typing we want to set the type properly.
Alternatives you tried
We copied the type from the
index.d.ts
to build this workaround.The text was updated successfully, but these errors were encountered: