diff --git a/src/Payment/payment.schema.ts b/src/Payment/payment.schema.ts index 5315511..afd6d7b 100644 --- a/src/Payment/payment.schema.ts +++ b/src/Payment/payment.schema.ts @@ -7,6 +7,7 @@ import { } from '@smatch-corp/nestjs-pothos'; import { Builder } from '../Graphql/graphql.builder'; import { PrismaService } from '../Prisma/prisma.service'; +import { PaymentStatus } from '@prisma/client'; @Injectable() export class PaymentSchema extends PothosSchema { @@ -24,7 +25,10 @@ export class PaymentSchema extends PothosSchema { fields: (t) => ({ id: t.exposeID('id'), amount: t.exposeFloat('amount'), - status: t.exposeString('status'), + status: t.expose('status', { + type: PaymentStatus, + nullable: false, + }), createdAt: t.expose('createdAt', { type: 'DateTime' }), updatedAt: t.expose('updatedAt', { type: 'DateTime' }), order: t.relation('Order'),