mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
remove unused global middleware
This commit is contained in:
parent
d9034b1bdb
commit
9816adc745
@ -1,7 +1,6 @@
|
|||||||
import { GraphQLSchema } from 'graphql'
|
import { GraphQLSchema } from 'graphql'
|
||||||
import { buildSchema } from 'type-graphql'
|
import { buildSchema } from 'type-graphql'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
// import { EventHandler } from '@/middleware/EventHandler'
|
|
||||||
|
|
||||||
import isAuthorized from './directive/isAuthorized'
|
import isAuthorized from './directive/isAuthorized'
|
||||||
import DecimalScalar from './scalar/Decimal'
|
import DecimalScalar from './scalar/Decimal'
|
||||||
@ -12,7 +11,6 @@ const schema = async (): Promise<GraphQLSchema> => {
|
|||||||
resolvers: [path.join(__dirname, 'resolver', `!(*.test).{js,ts}`)],
|
resolvers: [path.join(__dirname, 'resolver', `!(*.test).{js,ts}`)],
|
||||||
authChecker: isAuthorized,
|
authChecker: isAuthorized,
|
||||||
scalarsMap: [{ type: Decimal, scalar: DecimalScalar }],
|
scalarsMap: [{ type: Decimal, scalar: DecimalScalar }],
|
||||||
// globalMiddlewares: [EventHandler],
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user