super bug
This commit is contained in:
@@ -1,12 +1,7 @@
|
||||
import { JSONObjectResolver } from 'graphql-scalars'
|
||||
import PrismaPlugin, {
|
||||
PothosPrismaDatamodel,
|
||||
PrismaClient,
|
||||
} from '@pothos/plugin-prisma'
|
||||
import PrismaPlugin, { PothosPrismaDatamodel, PrismaClient } from '@pothos/plugin-prisma'
|
||||
import { Request, Response } from 'express'
|
||||
import SmartSubscriptionPlugin, {
|
||||
subscribeOptionsFromIterator,
|
||||
} from '@pothos/plugin-smart-subscriptions'
|
||||
import SmartSubscriptionPlugin, { subscribeOptionsFromIterator } from '@pothos/plugin-smart-subscriptions'
|
||||
import ZodPlugin from '@pothos/plugin-zod'
|
||||
import AuthzPlugin from '@pothos/plugin-authz'
|
||||
import ErrorsPlugin from '@pothos/plugin-errors'
|
||||
@@ -90,22 +85,11 @@ export class Builder extends SchemaBuilder<SchemaBuilderOption> {
|
||||
|
||||
constructor(private readonly prisma: PrismaClient) {
|
||||
super({
|
||||
plugins: [
|
||||
PrismaPlugin,
|
||||
PrismaUtils,
|
||||
SimpleObjectPlugin,
|
||||
SmartSubscriptionPlugin,
|
||||
RelayPlugin,
|
||||
ErrorsPlugin,
|
||||
AuthzPlugin,
|
||||
ZodPlugin,
|
||||
],
|
||||
plugins: [PrismaPlugin, PrismaUtils, SimpleObjectPlugin, SmartSubscriptionPlugin, RelayPlugin, ErrorsPlugin, AuthzPlugin, ZodPlugin],
|
||||
smartSubscriptions: {
|
||||
debounceDelay: 1000,
|
||||
...subscribeOptionsFromIterator((name, context) => {
|
||||
return context.isSubscription
|
||||
? context.websocket.pubSub.asyncIterator(name)
|
||||
: context.http.pubSub.asyncIterator(name)
|
||||
return context.isSubscription ? context.websocket.pubSub.asyncIterator(name) : context.http.pubSub.asyncIterator(name)
|
||||
}),
|
||||
},
|
||||
zod: {
|
||||
@@ -174,13 +158,9 @@ export class Builder extends SchemaBuilder<SchemaBuilderOption> {
|
||||
this.globalConnectionField('totalCount', (t) =>
|
||||
t.int({
|
||||
nullable: true,
|
||||
resolve: (parent) =>
|
||||
typeof parent.totalCount === 'function'
|
||||
? parent.totalCount()
|
||||
: parent.totalCount,
|
||||
resolve: (parent) => (typeof parent.totalCount === 'function' ? parent.totalCount() : parent.totalCount),
|
||||
}),
|
||||
)
|
||||
}
|
||||
}
|
||||
export type BuilderTypes =
|
||||
PothosSchemaTypes.ExtendDefaultTypes<SchemaBuilderOption>
|
||||
export type BuilderTypes = PothosSchemaTypes.ExtendDefaultTypes<SchemaBuilderOption>
|
||||
|
||||
Reference in New Issue
Block a user