Refactor WorkshopSchema: remove imageFileUrl field and update resolver parameters for consistency
This commit is contained in:
@@ -45,9 +45,6 @@ export class WorkshopSchema extends PothosSchema {
|
||||
imageFileId: t.exposeID('imageFileId', {
|
||||
description: 'The ID of the image file for the workshop.',
|
||||
}),
|
||||
imageFileUrl: t.exposeString('imageFileUrl', {
|
||||
description: 'The URL of the image file for the workshop.',
|
||||
}),
|
||||
date: t.expose('date', {
|
||||
type: 'DateTime',
|
||||
nullable: true,
|
||||
@@ -90,7 +87,7 @@ export class WorkshopSchema extends PothosSchema {
|
||||
type: this.workshop(),
|
||||
args: this.builder.generator.findUniqueArgs('Workshop'),
|
||||
description: 'Retrieve a single workshop by its unique identifier.',
|
||||
resolve: async (query, root, args, ctx, info) => {
|
||||
resolve: async (query, _root, args, _ctx, _info) => {
|
||||
return await this.prisma.workshop.findUnique({
|
||||
...query,
|
||||
where: args.where,
|
||||
@@ -103,7 +100,7 @@ export class WorkshopSchema extends PothosSchema {
|
||||
args: this.builder.generator.findManyArgs('Workshop'),
|
||||
description:
|
||||
'Retrieve a list of workshops with optional filtering, ordering, and pagination.',
|
||||
resolve: async (query, root, args, ctx, info) => {
|
||||
resolve: async (query, _root, args, _ctx, _info) => {
|
||||
return await this.prisma.workshop.findMany({
|
||||
...query,
|
||||
skip: args.skip ?? undefined,
|
||||
@@ -126,7 +123,7 @@ export class WorkshopSchema extends PothosSchema {
|
||||
}),
|
||||
},
|
||||
description: 'Create a new workshop.',
|
||||
resolve: async (query, root, args, ctx, info) => {
|
||||
resolve: async (query, _root, args, _ctx, _info) => {
|
||||
return await this.prisma.workshop.create({
|
||||
...query,
|
||||
data: args.input,
|
||||
@@ -147,7 +144,7 @@ export class WorkshopSchema extends PothosSchema {
|
||||
}),
|
||||
},
|
||||
description: 'Update an existing workshop.',
|
||||
resolve: async (query, root, args, ctx, info) => {
|
||||
resolve: async (query, _root, args, _ctx, _info) => {
|
||||
return await this.prisma.workshop.update({
|
||||
...query,
|
||||
where: args.where,
|
||||
|
||||
Reference in New Issue
Block a user