push code chua nhi?

This commit is contained in:
2024-11-11 22:04:39 +07:00
parent 22bc231409
commit ff45e69efd
7 changed files with 115 additions and 16 deletions

View File

@@ -12,7 +12,7 @@ import AuthzPlugin from '@pothos/plugin-authz'
import ErrorsPlugin from '@pothos/plugin-errors'
import type { FileUpload } from 'graphql-upload/processRequest.js'
import GraphQLUpload from 'graphql-upload/GraphQLUpload.js'
import { Injectable } from '@nestjs/common'
import { Injectable, Logger } from '@nestjs/common'
import { PrismaCrudGenerator } from './graphql.generator'
import type PrismaTypes from '../types/pothos.generated'
import PrismaUtils from '@pothos/plugin-prisma-utils'
@@ -107,6 +107,7 @@ export class Builder extends SchemaBuilder<SchemaBuilderOption> {
// optionally customize how errors are formatted
validationError: (zodError, _args, _context, _info) => {
// the default behavior is to just throw the zod error directly
Logger.error(zodError.message, 'Zod Error')
return zodError
},
},