implement platform config

This commit is contained in:
2024-10-29 19:06:01 +07:00
parent 075610fb9b
commit e003bcd634
11 changed files with 213 additions and 82 deletions

View File

@@ -69,7 +69,7 @@ export class CategorySchema extends PothosSchema {
'Retrieve a list of categories with optional filtering, ordering, and pagination.',
type: [this.category()],
args: this.builder.generator.findManyArgs('Category'),
resolve: async (query, root, args) => {
resolve: async (query, _root, args) => {
return await this.prisma.category.findMany({
...query,
skip: args.skip ?? undefined,
@@ -83,7 +83,7 @@ export class CategorySchema extends PothosSchema {
description: 'Retrieve a single category by its unique identifier.',
type: this.category(),
args: this.builder.generator.findUniqueArgs('Category'),
resolve: async (query, root, args) => {
resolve: async (query, _root, args) => {
return await this.prisma.category.findUnique({
...query,
where: args.where ?? undefined,
@@ -95,7 +95,7 @@ export class CategorySchema extends PothosSchema {
'Retrieve a list of subcategories with optional filtering, ordering, and pagination.',
type: [this.subCategory()],
args: this.builder.generator.findManyArgs('SubCategory'),
resolve: async (query, root, args) => {
resolve: async (query, _root, args) => {
return await this.prisma.subCategory.findMany({
...query,
where: args.filter ?? undefined,
@@ -118,7 +118,7 @@ export class CategorySchema extends PothosSchema {
required: true,
}),
},
resolve: async (query, root, args) => {
resolve: async (_query, _root, args) => {
return await this.prisma.category.create({
data: args.input,
})
@@ -133,7 +133,7 @@ export class CategorySchema extends PothosSchema {
required: true,
}),
},
resolve: async (query, root, args) => {
resolve: async (_query, _root, args) => {
return await this.prisma.category.createManyAndReturn({
data: args.data,
skipDuplicates: true,
@@ -150,7 +150,7 @@ export class CategorySchema extends PothosSchema {
required: true,
}),
},
resolve: async (query, root, args) => {
resolve: async (_query, _root, args) => {
return await this.prisma.subCategory.create({
data: args.input,
})