Add initial sentry setup
Related to #343 but will probably need a few more changes
This commit is contained in:
@@ -3,6 +3,7 @@ import {
|
||||
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}'
|
||||
@@ -16,6 +17,9 @@ export const handler = createGraphQLHandler({
|
||||
schemas,
|
||||
services: makeServices({ services }),
|
||||
}),
|
||||
plugins: [
|
||||
createSentryApolloPlugin(),
|
||||
],
|
||||
onException: () => {
|
||||
// Disconnect from your database with an unhandled exception.
|
||||
db.$disconnect()
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { createUserInsecure } from 'src/services/users/users.js'
|
||||
import { db } from 'src/lib/db'
|
||||
import { sentryWrapper } from 'src/lib/sentry'
|
||||
import { enforceAlphaNumeric, generateUniqueString } from 'src/services/helpers'
|
||||
|
||||
export const handler = async (req, _context) => {
|
||||
const unWrappedHandler = async (req, _context) => {
|
||||
const body = JSON.parse(req.body)
|
||||
console.log(body)
|
||||
console.log(_context)
|
||||
@@ -82,3 +83,5 @@ export const handler = async (req, _context) => {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const handler = sentryWrapper(unWrappedHandler)
|
||||
|
||||
Reference in New Issue
Block a user