update service status
This commit is contained in:
@@ -18,11 +18,17 @@ import SmartSubscriptionPlugin, {
|
||||
subscribeOptionsFromIterator,
|
||||
} from '@pothos/plugin-smart-subscriptions';
|
||||
import RelayPlugin from '@pothos/plugin-relay';
|
||||
import ErrorsPlugin from '@pothos/plugin-errors';
|
||||
import AuthzPlugin from '@pothos/plugin-authz';
|
||||
import { User } from '@prisma/client';
|
||||
// import { rules } from '../common/graphql/common.graphql.auth-rule';
|
||||
|
||||
export interface SchemaContext {
|
||||
req: Request;
|
||||
res: Response;
|
||||
generator: PrismaCrudGenerator<BuilderTypes>;
|
||||
me: User;
|
||||
pubSub: PubSub;
|
||||
generator: PrismaCrudGenerator<BuilderTypes>;
|
||||
}
|
||||
|
||||
export interface SchemaBuilderOption {
|
||||
@@ -32,6 +38,7 @@ export interface SchemaBuilderOption {
|
||||
Connection: {
|
||||
totalCount: number | (() => number | Promise<number>);
|
||||
};
|
||||
// AuthZRule: keyof typeof rules;
|
||||
Scalars: {
|
||||
DateTime: {
|
||||
Input: Date;
|
||||
@@ -60,6 +67,8 @@ export class Builder extends SchemaBuilder<SchemaBuilderOption> {
|
||||
SimpleObjectPlugin,
|
||||
SmartSubscriptionPlugin,
|
||||
RelayPlugin,
|
||||
ErrorsPlugin,
|
||||
AuthzPlugin,
|
||||
],
|
||||
smartSubscriptions: {
|
||||
debounceDelay: 1000,
|
||||
@@ -75,6 +84,9 @@ export class Builder extends SchemaBuilder<SchemaBuilderOption> {
|
||||
onUnusedQuery: process.env.NODE_ENV === 'production' ? null : 'warn',
|
||||
dmmf: getDatamodel(),
|
||||
},
|
||||
errors: {
|
||||
defaultTypes: [],
|
||||
},
|
||||
});
|
||||
this.generator = new PrismaCrudGenerator<BuilderTypes>(this);
|
||||
this.addScalarType('DateTime', DateTimeResolver);
|
||||
@@ -83,7 +95,7 @@ export class Builder extends SchemaBuilder<SchemaBuilderOption> {
|
||||
|
||||
this.queryType({});
|
||||
this.mutationType({});
|
||||
// this.subscriptionType({});
|
||||
this.subscriptionType({});
|
||||
|
||||
this.globalConnectionField('totalCount', (t) =>
|
||||
t.int({
|
||||
|
||||
Reference in New Issue
Block a user