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, + }, + }) +}