From 15d30d2f569b2d609ff556bd47349eaa88e2bb5d Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Fri, 1 Dec 2023 10:11:13 +0100 Subject: [PATCH] add schema --- src/graphql/schema.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/graphql/schema.ts diff --git a/src/graphql/schema.ts b/src/graphql/schema.ts new file mode 100644 index 0000000..315a489 --- /dev/null +++ b/src/graphql/schema.ts @@ -0,0 +1,18 @@ +import path from 'path' + +import { GraphQLSchema } from 'graphql' +import { buildSchema } from 'type-graphql' + +export const schema = async (): Promise => { + return buildSchema({ + resolvers: [path.join(__dirname, 'resolvers', `!(*.spec).{ts}`)], + validate: { + validationError: { target: false }, + skipMissingProperties: true, + skipNullProperties: true, + skipUndefinedProperties: false, + forbidUnknownValues: true, + stopAtFirstError: true, + }, + }) +}