@@ -80,7 +80,13 @@ Now define a `ConnectionBuilder` class for your `Connection` object. The builder
8080pagination arguments for the connection, and creating the cursors and ` Edge ` objects that make up the connection.
8181
8282``` ts
83- import { ConnectionBuilder , Cursor , PageInfo , validateParamsUsingSchema } from ' nestjs-graphql-connection' ;
83+ import {
84+ ConnectionBuilder ,
85+ Cursor ,
86+ EdgeInputWithCursor ,
87+ PageInfo ,
88+ validateParamsUsingSchema ,
89+ } from ' nestjs-graphql-connection' ;
8490
8591export type PersonCursorParams = { id: string };
8692export type PersonCursor = Cursor <PersonCursorParams >;
@@ -96,7 +102,7 @@ export class PersonConnectionBuilder extends ConnectionBuilder<
96102 return new PersonConnection (fields );
97103 }
98104
99- public createEdge(fields : { node : TestNode ; cursor : string } ): TestEdge {
105+ public createEdge(fields : EdgeInputWithCursor < PersonEdge > ): PersonEdge {
100106 return new PersonEdge (fields );
101107 }
102108
@@ -168,7 +174,12 @@ determining what the last result was on page 9.
168174To use offset cursors, extend your builder class from ` OffsetPaginatedConnectionBuilder ` instead of ` ConnectionBuilder ` :
169175
170176``` ts
171- import { OffsetPaginatedConnectionBuilder , PageInfo , validateParamsUsingSchema } from ' nestjs-graphql-connection' ;
177+ import {
178+ EdgeInputWithCursor ,
179+ OffsetPaginatedConnectionBuilder ,
180+ PageInfo ,
181+ validateParamsUsingSchema ,
182+ } from ' nestjs-graphql-connection' ;
172183
173184export class PersonConnectionBuilder extends OffsetPaginatedConnectionBuilder <
174185 PersonConnection ,
@@ -180,7 +191,7 @@ export class PersonConnectionBuilder extends OffsetPaginatedConnectionBuilder<
180191 return new PersonConnection (fields );
181192 }
182193
183- public createEdge(fields : { node : TestNode ; cursor : string } ): TestEdge {
194+ public createEdge(fields : EdgeInputWithCursor < PersonEdge > ): PersonEdge {
184195 return new PersonEdge (fields );
185196 }
186197
0 commit comments