Skip to content

Commit

Permalink
fix(relay): return default PageInfo when items are empty
Browse files Browse the repository at this point in the history
  • Loading branch information
metmirr committed Mar 16, 2021
1 parent 3214bc9 commit abac5ab
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/core/RelayService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,12 @@ export class RelayService {
pageOptions: RelayPageOptions
): PageInfo {
if (!items.length) {
throw new Error('Items is empty');
return {
hasNextPage: false,
hasPreviousPage: false,
startCursor: '',
endCursor: ''
};
}
let limit;
let cursor;
Expand Down

0 comments on commit abac5ab

Please sign in to comment.