update service status

This commit is contained in:
2024-10-23 15:43:50 +07:00
parent 7e55f4093b
commit 2872ac69ef
14 changed files with 212 additions and 32 deletions

View File

@@ -0,0 +1,9 @@
import { Module } from '@nestjs/common';
import { CommonGraphqlError } from './graphql/common.graphql.error';
@Module({
imports: [],
providers: [CommonGraphqlError],
exports: [CommonGraphqlError],
})
export class CommonModule {}

View File

@@ -0,0 +1,24 @@
import { Inject, Injectable } from '@nestjs/common';
import { Builder } from '../../Graphql/graphql.builder';
import {
PothosRef,
PothosSchema,
SchemaBuilderToken,
} from '@smatch-corp/nestjs-pothos';
@Injectable()
export class CommonGraphqlError extends PothosSchema {
constructor(@Inject(SchemaBuilderToken) private readonly builder: Builder) {
super();
}
@PothosRef()
error() {
return this.builder.objectType(Error, {
name: 'Error',
fields: (t) => ({
message: t.exposeString('message'),
}),
});
}
}