update service and category
This commit is contained in:
@@ -7,7 +7,7 @@ import { Request, Response } from 'express'
|
||||
import SmartSubscriptionPlugin, {
|
||||
subscribeOptionsFromIterator,
|
||||
} from '@pothos/plugin-smart-subscriptions'
|
||||
|
||||
import ZodPlugin from '@pothos/plugin-zod'
|
||||
import AuthzPlugin from '@pothos/plugin-authz'
|
||||
import ErrorsPlugin from '@pothos/plugin-errors'
|
||||
import type { FileUpload } from 'graphql-upload/processRequest.js'
|
||||
@@ -92,6 +92,7 @@ export class Builder extends SchemaBuilder<SchemaBuilderOption> {
|
||||
RelayPlugin,
|
||||
ErrorsPlugin,
|
||||
AuthzPlugin,
|
||||
ZodPlugin,
|
||||
],
|
||||
smartSubscriptions: {
|
||||
debounceDelay: 1000,
|
||||
@@ -102,6 +103,13 @@ export class Builder extends SchemaBuilder<SchemaBuilderOption> {
|
||||
return ctx.http.pubSub.asyncIterator(name)
|
||||
}),
|
||||
},
|
||||
zod: {
|
||||
// optionally customize how errors are formatted
|
||||
validationError: (zodError, _args, _context, _info) => {
|
||||
// the default behavior is to just throw the zod error directly
|
||||
return zodError
|
||||
},
|
||||
},
|
||||
relay: {},
|
||||
prisma: {
|
||||
client: prisma,
|
||||
|
||||
Reference in New Issue
Block a user