2021-10-18 23:42:47 +02:00

15 lines
370 B
TypeScript

import { GraphQLSchema } from 'graphql'
import { buildSchema } from 'type-graphql'
import path from 'path'
import isAuthorized from './directive/isAuthorized'
const schema = async (): Promise<GraphQLSchema> => {
return buildSchema({
resolvers: [path.join(__dirname, 'resolver', `!(*.test).{js,ts}`)],
authChecker: isAuthorized,
})
}
export default schema