mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
19 lines
519 B
TypeScript
19 lines
519 B
TypeScript
import path from 'path'
|
|
|
|
import { Decimal } from 'decimal.js-light'
|
|
import { GraphQLSchema } from 'graphql'
|
|
import { buildSchema } from 'type-graphql'
|
|
|
|
import isAuthorized from './directive/isAuthorized'
|
|
import DecimalScalar from './scalar/Decimal'
|
|
|
|
const schema = async (): Promise<GraphQLSchema> => {
|
|
return buildSchema({
|
|
resolvers: [path.join(__dirname, 'resolver', `!(*.test).{js,ts}`)],
|
|
authChecker: isAuthorized,
|
|
scalarsMap: [{ type: Decimal, scalar: DecimalScalar }],
|
|
})
|
|
}
|
|
|
|
export default schema
|