Files
cadhub/app/api/src/functions/graphql.js
Kurt Hutten 52bf8922c4 Lint project
2021-06-24 20:36:56 +10:00

26 lines
641 B
JavaScript

import {
createGraphQLHandler,
makeMergedSchema,
makeServices,
} from '@redwoodjs/api'
import { createSentryApolloPlugin } from 'src/lib/sentry'
import schemas from 'src/graphql/**/*.{js,ts}'
import services from 'src/services/**/*.{js,ts}'
import { getCurrentUser } from 'src/lib/auth'
import { db } from 'src/lib/db'
export const handler = createGraphQLHandler({
getCurrentUser,
schema: makeMergedSchema({
schemas,
services: makeServices({ services }),
}),
plugins: [createSentryApolloPlugin()],
onException: () => {
// Disconnect from your database with an unhandled exception.
db.$disconnect()
},
})