remove unused global middleware

This commit is contained in:
Moriz Wahl 2022-07-01 17:24:51 +02:00
parent d9034b1bdb
commit 9816adc745
2 changed files with 0 additions and 17 deletions

View File

@ -1,7 +1,6 @@
import { GraphQLSchema } from 'graphql'
import { buildSchema } from 'type-graphql'
import path from 'path'
// import { EventHandler } from '@/middleware/EventHandler'
import isAuthorized from './directive/isAuthorized'
import DecimalScalar from './scalar/Decimal'
@ -12,7 +11,6 @@ const schema = async (): Promise<GraphQLSchema> => {
resolvers: [path.join(__dirname, 'resolver', `!(*.test).{js,ts}`)],
authChecker: isAuthorized,
scalarsMap: [{ type: Decimal, scalar: DecimalScalar }],
// globalMiddlewares: [EventHandler],
})
}

View File

@ -1,15 +0,0 @@
import { MiddlewareFn } from 'type-graphql'
import { EventProtocol } from '@entity/EventProtocol'
export const EventHandler: MiddlewareFn = async (
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
{ root, args, context, info },
next,
) => {
const event = new EventProtocol()
// set values before calling the resolver here
const result = await next()
// set event values here when having the result ...
await event.save()
return result
}