Skip to content

Commit c17e0e9

Browse files
committed
Fix code style issues with Prettier
1 parent 4b15512 commit c17e0e9

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class PersonConnection extends createConnectionType(PersonEdge) {}
3939

4040
### Create a Connection Arguments type
4141

42-
Extend a class from `ConnectionArgs` class to have pagination arguments pre-defined for you. You can additionally
42+
Extend a class from `ConnectionArgs` class to have pagination arguments pre-defined for you. You can additionally
4343
define your own arguments for filtering, etc.
4444

4545
```ts
@@ -51,7 +51,7 @@ export class PersonConnectionArgs extends ConnectionArgs {
5151
/*
5252
* PersonConnectionArgs will inherit `first`, `last`, `before`, `after`, and `page` fields from ConnectionArgs
5353
*/
54-
54+
5555
// Optional: example of a custom argument for filtering
5656
@Field(type => ID, { nullable: true })
5757
public personId?: string;
@@ -76,20 +76,18 @@ import { OffsetCursorPaginator } from 'nestjs-graphql-connection';
7676
@Resolver()
7777
export class PersonQueryResolver {
7878
@Query(returns => PersonConnection)
79-
public async persons(
80-
@Args() connectionArgs: PersonConnectionArgs,
81-
): Promise<PersonConnection> {
79+
public async persons(@Args() connectionArgs: PersonConnectionArgs): Promise<PersonConnection> {
8280
const { personId } = connectionArgs;
83-
81+
8482
// Example: Count the total number of matching persons (ignoring pagination)
8583
const totalPersons = await countPersons({ where: { personId } });
8684

8785
// Create paginator instance
8886
const paginator = OffsetCursorPaginator.createFromConnectionArgs(connectionArgs, totalPersons);
8987

9088
// Example: Do whatever you need to do to fetch the current page of persons
91-
const persons = await fetchPersons({
92-
where: { personId },
89+
const persons = await fetchPersons({
90+
where: { personId },
9391
take: paginator.take, // how many rows to fetch
9492
skip: paginator.skip, // row offset to fetch from
9593
});

src/cursor/OffsetCursorPaginator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { ConnectionArgsValidationError, CursorValidationError } from '../error';
55

66
export type OffsetCursorParameters = {
77
offset: number;
8-
}
8+
};
99

1010
export class OffsetCursor extends Cursor<OffsetCursorParameters> {
1111
public static create(encodedString: string): OffsetCursor {

0 commit comments

Comments
 (0)