update websocket

This commit is contained in:
2024-11-06 17:16:10 +07:00
parent ef5c753ce4
commit 57037a59ec
18 changed files with 129 additions and 71 deletions

View File

@@ -1,4 +1,4 @@
import { DateTimeResolver, JSONObjectResolver } from 'graphql-scalars'
import { JSONObjectResolver } from 'graphql-scalars'
import PrismaPlugin, {
PothosPrismaDatamodel,
PrismaClient,
@@ -25,8 +25,7 @@ import { getDatamodel } from '../types/pothos.generated'
import { DateTime } from 'luxon'
import { Kind } from 'graphql'
import { DateTimeUtils } from '../common/utils/datetime.utils'
// import { rules } from '../common/graphql/common.graphql.auth-rule';
import { JsonValue } from '@prisma/client/runtime/library'
export type SchemaContext =
| {
@@ -65,8 +64,8 @@ export interface SchemaBuilderOption {
Output: string | DateTime | Date
}
Json: {
Input: JSON
Output: JSON
Input: JsonValue
Output: JsonValue
}
Upload: {
Input: FileUpload
@@ -161,8 +160,6 @@ export class Builder extends SchemaBuilder<SchemaBuilderOption> {
: parent.totalCount,
}),
)
// test print ManagedServiceWhereUniqueInput
}
}
export type BuilderTypes =

View File

@@ -41,6 +41,7 @@ import { WorkshopSubscriptionModule } from '../WorkshopSubscription/workshopsubs
import { initContextCache } from '@pothos/core'
import { PubSub } from 'graphql-subscriptions'
import { isSubscription } from 'rxjs/internal/Subscription'
import { EventEmitter } from 'ws'
@Global()
@Module({
@@ -147,7 +148,10 @@ import { isSubscription } from 'rxjs/internal/Subscription'
},
{
provide: 'PUB_SUB',
useFactory: () => new PubSub(),
useFactory: () =>
new PubSub({
eventEmitter: new EventEmitter({}),
}),
},
],
exports: [