thang an pha qua

This commit is contained in:
2024-11-08 15:15:59 +07:00
parent 57037a59ec
commit 1897ccf677
4 changed files with 43 additions and 12 deletions

View File

@@ -40,8 +40,6 @@ import { WorkshopOrganizationModule } from '../WorkshopOrganization/workshoporga
import { WorkshopSubscriptionModule } from '../WorkshopSubscription/workshopsubscription.module'
import { initContextCache } from '@pothos/core'
import { PubSub } from 'graphql-subscriptions'
import { isSubscription } from 'rxjs/internal/Subscription'
import { EventEmitter } from 'ws'
@Global()
@Module({
@@ -90,7 +88,6 @@ import { EventEmitter } from 'ws'
debug: process.env.NODE_ENV === 'development' || false,
playground: process.env.NODE_ENV === 'development' || false,
introspection: process.env.NODE_ENV === 'development' || false,
installSubscriptionHandlers: true,
subscriptions: {
'graphql-ws': true,
},
@@ -100,6 +97,7 @@ import { EventEmitter } from 'ws'
extra,
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
}: { req?: Request; subscriptions?: any; extra?: any }) => {
initContextCache()
if (subscriptions) {
return {
isSubscription: true,
@@ -148,10 +146,7 @@ import { EventEmitter } from 'ws'
},
{
provide: 'PUB_SUB',
useFactory: () =>
new PubSub({
eventEmitter: new EventEmitter({}),
}),
useFactory: () => new PubSub(),
},
],
exports: [