-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
I’ve been going through the examples in the README, but I can’t seem to get the examples with the (cursor) => pattern to work.
For example taking the TS example and making it JS:
octokit.graphql.paginate((cursor) => {
return `{
repository(owner: "octokit", name: "rest.js") {
issues(first: 10, after: ${cursor.create()}) {
nodes {
title
}
pageInfo {
hasNextPage
endCursor
}
}
}
}`;
}).then(console.log);
I get one of these gnarly errors:
/Users/williammartin/workspace/octokit-playground/node_modules/@octokit/graphql/dist-node/index.js:113
throw new GraphqlResponseError(
^
GraphqlResponseError: Request failed due to following response errors:
- A query attribute must be specified and must be a string.
I also can’t find any examples in the wild of this pattern of usage:
https://github.com/search?type=code&q=%2Foctokit%5C.graphql%5C.paginate%3C.*%3E%5C%28%5C%28cursor%5C%29%2F
https://github.com/search?type=code&q=octokit.graphql.paginate%28%28cursor%29
And my pretty questionable TS reading of the type signature tells me this shouldn’t be possible?
plugin-paginate-graphql.js/src/paginate.ts
Lines 7 to 11 in 8e3bce1
| return async <ResponseType extends object = any>( | |
| query: string, | |
| initialParameters: Record<string, any> = {}, | |
| ): Promise<ResponseType> => { | |
| let mergedResponse: ResponseType = {} as ResponseType; |
fheinecke
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
🔥 Backlog