Files
cadhub/app/api/src/functions/graphql.js
Kurt Hutten 2e91c74baf Add initial sentry setup
Related to #343 but will probably need a few more changes
2021-06-05 20:32:56 +10:00

28 lines
650 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()
},
})