mirror of
https://github.com/IT4Change/boilerplate-backend.git
synced 2025-12-13 10:25:49 +00:00
add schema
This commit is contained in:
parent
2821972fbb
commit
15d30d2f56
18
src/graphql/schema.ts
Normal file
18
src/graphql/schema.ts
Normal 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,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user