refactor source code
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { PaymentSchema } from './payment.schema';
|
||||
import { Module } from '@nestjs/common'
|
||||
import { PaymentSchema } from './payment.schema'
|
||||
|
||||
@Module({
|
||||
providers: [PaymentSchema],
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import { Inject, Injectable } from '@nestjs/common'
|
||||
import {
|
||||
Pothos,
|
||||
PothosRef,
|
||||
PothosSchema,
|
||||
SchemaBuilderToken,
|
||||
} from '@smatch-corp/nestjs-pothos';
|
||||
import { Builder } from '../Graphql/graphql.builder';
|
||||
import { PrismaService } from '../Prisma/prisma.service';
|
||||
import { PaymentStatus } from '@prisma/client';
|
||||
} 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 {
|
||||
@@ -15,7 +15,7 @@ export class PaymentSchema extends PothosSchema {
|
||||
@Inject(SchemaBuilderToken) private readonly builder: Builder,
|
||||
private readonly prisma: PrismaService,
|
||||
) {
|
||||
super();
|
||||
super()
|
||||
}
|
||||
|
||||
// Types section
|
||||
@@ -46,7 +46,7 @@ export class PaymentSchema extends PothosSchema {
|
||||
description: 'The order for the payment.',
|
||||
}),
|
||||
}),
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
// Queries section
|
||||
@@ -61,7 +61,7 @@ export class PaymentSchema extends PothosSchema {
|
||||
return await this.prisma.payment.findUnique({
|
||||
...query,
|
||||
where: args.where,
|
||||
});
|
||||
})
|
||||
},
|
||||
}),
|
||||
payments: t.prismaField({
|
||||
@@ -77,9 +77,9 @@ export class PaymentSchema extends PothosSchema {
|
||||
cursor: args.cursor ?? undefined,
|
||||
take: args.take ?? undefined,
|
||||
skip: args.skip ?? undefined,
|
||||
});
|
||||
})
|
||||
},
|
||||
}),
|
||||
}));
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user