From 589377ea846f2a73051816ecd89cc0800b1dbf12 Mon Sep 17 00:00:00 2001 From: ghiscoding Date: Fri, 10 Nov 2023 19:26:00 -0500 Subject: [PATCH 1/3] chore: prefer `useCursor` instead of deprecated `isWithCursor` --- src/app/examples/grid-graphql.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/examples/grid-graphql.component.ts b/src/app/examples/grid-graphql.component.ts index 3f53ad44c..4877b73d8 100644 --- a/src/app/examples/grid-graphql.component.ts +++ b/src/app/examples/grid-graphql.component.ts @@ -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 @@ -359,7 +359,7 @@ export class GridGraphqlComponent implements OnInit, OnDestroy { setIsWithCursor(isWithCursor: boolean) { this.isWithCursor = isWithCursor; - this.resetOptions({ isWithCursor: this.isWithCursor }); + this.resetOptions({ useCursor: this.isWithCursor }); return true; } From 78fa29bb859dc4ea76094ca5d5e0be3a779fb09d Mon Sep 17 00:00:00 2001 From: ghiscoding Date: Fri, 10 Nov 2023 19:49:57 -0500 Subject: [PATCH 2/3] chore: refactor to `useCursor` to fix Cypress tests --- src/app/examples/grid-graphql.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/examples/grid-graphql.component.ts b/src/app/examples/grid-graphql.component.ts index 4877b73d8..abd4b9660 100644 --- a/src/app/examples/grid-graphql.component.ts +++ b/src/app/examples/grid-graphql.component.ts @@ -365,7 +365,7 @@ export class GridGraphqlComponent implements OnInit, OnDestroy { private resetOptions(options: Partial) { const graphqlService = this.gridOptions.backendServiceApi!.service as GraphqlService; - this.angularGrid.paginationService!.setCursorBased(options.isWithCursor!); + this.angularGrid.paginationService!.setCursorBased(options.useCursor!); this.angularGrid.paginationService?.goToFirstPage(); graphqlService.updateOptions(options); this.gridOptions = { ...this.gridOptions }; From b6cc50918240237933513d5fb6d2707eb9ceba0f Mon Sep 17 00:00:00 2001 From: ghiscoding Date: Fri, 10 Nov 2023 20:21:37 -0500 Subject: [PATCH 3/3] chore: GrahphQL demo go to first page only after changing to cursor based --- src/app/examples/grid-graphql.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/examples/grid-graphql.component.ts b/src/app/examples/grid-graphql.component.ts index abd4b9660..df3912ce7 100644 --- a/src/app/examples/grid-graphql.component.ts +++ b/src/app/examples/grid-graphql.component.ts @@ -366,9 +366,9 @@ export class GridGraphqlComponent implements OnInit, OnDestroy { private resetOptions(options: Partial) { const graphqlService = this.gridOptions.backendServiceApi!.service as GraphqlService; this.angularGrid.paginationService!.setCursorBased(options.useCursor!); - this.angularGrid.paginationService?.goToFirstPage(); graphqlService.updateOptions(options); this.gridOptions = { ...this.gridOptions }; + this.angularGrid.paginationService?.goToFirstPage(); } switchLanguage() {