Comparing version 1.4.0 to 1.4.1
@@ -27,5 +27,5 @@ import { GraphQLClient } from 'graphql-request'; | ||
getCount({ since, ...others }: SDK.IGetCountQueryVariables): Promise<number>; | ||
getList({ limit, ...others }: SDK.IGetListQueryVariables): Promise<ICommit[]>; | ||
getList(options: Omit<SDK.IGetListQueryVariables, 'limit'>): Promise<ICommit[]>; | ||
getLastCommit(options: SDK.IGetLastCommitQueryVariables): Promise<ILastCommitInfo | undefined>; | ||
} | ||
export {}; |
@@ -26,2 +26,3 @@ "use strict"; | ||
const SDK = __importStar(require("../__generated__/sdk/commit")); | ||
const constants_1 = require("../constants"); | ||
const Query_1 = __importDefault(require("./Query")); | ||
@@ -39,4 +40,4 @@ class CommitQuery extends Query_1.default { | ||
} | ||
async getList({ limit, ...others }) { | ||
const args = { ...others, limit }; | ||
async getList(options) { | ||
const args = { ...options, limit: constants_1.MAX_PAGE_SIZE }; | ||
const response = await this.execute(this.sdk.getList, args); | ||
@@ -49,3 +50,3 @@ const nodes = []; | ||
const promises = []; | ||
const pagesCount = Math.ceil(history.totalCount / limit); | ||
const pagesCount = Math.ceil(history.totalCount / constants_1.MAX_PAGE_SIZE); | ||
let pageIndex = 0; | ||
@@ -52,0 +53,0 @@ while (pagesCount > pageIndex) { |
{ | ||
"name": "gh-gql", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "GitHub GraphQL API helper for TypeScript", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/keindev/gh-gql#readme", |
472476
31
11912