push code push code
This commit is contained in:
@@ -22,6 +22,7 @@ export class PaymentSchema extends PothosSchema {
|
||||
@PothosRef()
|
||||
payment() {
|
||||
return this.builder.prismaObject('Payment', {
|
||||
description: 'A payment in the system.',
|
||||
fields: (t) => ({
|
||||
id: t.exposeID('id'),
|
||||
amount: t.exposeFloat('amount'),
|
||||
@@ -42,6 +43,7 @@ export class PaymentSchema extends PothosSchema {
|
||||
this.builder.queryFields((t) => ({
|
||||
payment: t.prismaField({
|
||||
type: this.payment(),
|
||||
description: 'Retrieve a single payment by its unique identifier.',
|
||||
args: this.builder.generator.findUniqueArgs('Payment'),
|
||||
resolve: async (query, root, args, ctx, info) => {
|
||||
return await this.prisma.payment.findUnique({
|
||||
@@ -53,6 +55,8 @@ export class PaymentSchema extends PothosSchema {
|
||||
payments: t.prismaField({
|
||||
type: [this.payment()],
|
||||
args: this.builder.generator.findManyArgs('Payment'),
|
||||
description:
|
||||
'Retrieve a list of payments with optional filtering, ordering, and pagination.',
|
||||
resolve: async (query, root, args, ctx, info) => {
|
||||
return await this.prisma.payment.findMany({
|
||||
...query,
|
||||
|
||||
Reference in New Issue
Block a user