You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
demo-graphql-oauth/src/utils/createSchema.ts

16 lines
435 B

import { buildSchema, MiddlewareFn } from "type-graphql"
import { UserResolver } from "../modules/User/UserResolver"
const ErrorInterceptor: MiddlewareFn<any> = async ({}, next) => {
try {
return await next()
} catch (err) {
console.error(err)
}
}
export const createSchema = () =>
buildSchema({
resolvers: [UserResolver],
globalMiddlewares: [ErrorInterceptor],
})