implement platform config
This commit is contained in:
@@ -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,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user