add schema

This commit is contained in:
Moriz Wahl 2023-12-01 10:11:13 +01:00
parent 2821972fbb
commit 15d30d2f56

18
src/graphql/schema.ts Normal file
View File

@ -0,0 +1,18 @@
import path from 'path'
import { GraphQLSchema } from 'graphql'
import { buildSchema } from 'type-graphql'
export const schema = async (): Promise<GraphQLSchema> => {
return buildSchema({
resolvers: [path.join(__dirname, 'resolvers', `!(*.spec).{ts}`)],
validate: {
validationError: { target: false },
skipMissingProperties: true,
skipNullProperties: true,
skipUndefinedProperties: false,
forbidUnknownValues: true,
stopAtFirstError: true,
},
})
}