Files
twenty/server/src/utils/pagination/page-info.ts
T
Jérémy M b1171e22a3 feat: add findAll and findUnique resolver for universal objects (#1576)
* wip: refacto and start creating custom resolver

* feat: findMany & findUnique of a custom entity

* feat: wip pagination

* feat: initial metadata migration

* feat: universal findAll with pagination

* fix: clean small stuff in pagination

* fix: test

* fix: miss file

* feat: rename custom into universal

* feat: create metadata schema in default database

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2023-09-20 17:24:13 -07:00

20 lines
527 B
TypeScript

import { Field, ObjectType } from '@nestjs/graphql';
import { IPageInfo } from './interfaces/page-info.interface';
import { ConnectionCursor } from './interfaces/connection-cursor.type';
@ObjectType({ isAbstract: true })
export class PageInfo implements IPageInfo {
@Field({ nullable: true })
public startCursor!: ConnectionCursor;
@Field({ nullable: true })
public endCursor!: ConnectionCursor;
@Field(() => Boolean)
public hasPreviousPage!: boolean;
@Field(() => Boolean)
public hasNextPage!: boolean;
}