Skip to content

Commit

Permalink
Merge pull request #1311 from ghiscoding/chore/use-cursor
Browse files Browse the repository at this point in the history
chore: prefer `useCursor` instead of deprecated `isWithCursor`
  • Loading branch information
ghiscoding committed Nov 11, 2023
2 parents 768a0ae + b6060f7 commit 7d89b39
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/examples/grid-graphql.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export class GridGraphqlComponent implements OnInit, OnDestroy {
field: 'userId',
value: 123
}],
isWithCursor: this.isWithCursor, // sets pagination strategy, if true requires a call to setPageInfo() when graphql call returns
useCursor: this.isWithCursor, // sets pagination strategy, if true requires a call to setPageInfo() when graphql call returns
// when dealing with complex objects, we want to keep our field name with double quotes
// example with gender: query { users (orderBy:[{field:"gender",direction:ASC}]) {}
keepArgumentFieldDoubleQuotes: true
Expand Down Expand Up @@ -359,13 +359,13 @@ export class GridGraphqlComponent implements OnInit, OnDestroy {

setIsWithCursor(isWithCursor: boolean) {
this.isWithCursor = isWithCursor;
this.resetOptions({ isWithCursor: this.isWithCursor });
this.resetOptions({ useCursor: this.isWithCursor });
return true;
}

private resetOptions(options: Partial<GraphqlServiceOption>) {
const graphqlService = this.gridOptions.backendServiceApi!.service as GraphqlService;
this.angularGrid.paginationService!.setCursorBased(options.isWithCursor!);
this.angularGrid.paginationService!.setCursorBased(options.useCursor as boolean);
graphqlService.updateOptions(options);
this.gridOptions = { ...this.gridOptions };
this.angularGrid.paginationService?.goToFirstPage();
Expand Down

0 comments on commit 7d89b39

Please sign in to comment.