HBE-155 Common input-args for Pagination (#19)
* feat: common input-args added * chore: move common input-types.args.ts into types folder * fix: add gql InputType annotation * docs: update field description
This commit is contained in:
parent
b60d45ba76
commit
24dd535d9e
1 changed files with 19 additions and 0 deletions
19
packages/hoppscotch-backend/src/types/input-types.args.ts
Normal file
19
packages/hoppscotch-backend/src/types/input-types.args.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { ArgsType, Field, InputType } from '@nestjs/graphql';
|
||||
|
||||
@ArgsType()
|
||||
@InputType()
|
||||
export class PaginationArgs {
|
||||
@Field({
|
||||
nullable: true,
|
||||
defaultValue: undefined,
|
||||
description: 'Cursor for pagination, ID of the last item in the list',
|
||||
})
|
||||
cursor: string;
|
||||
|
||||
@Field({
|
||||
nullable: true,
|
||||
defaultValue: 10,
|
||||
description: 'Number of items to fetch',
|
||||
})
|
||||
take: number;
|
||||
}
|
||||
Loading…
Reference in a new issue