You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+31-9Lines changed: 31 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,14 +29,11 @@ const resolvers = {
29
29
}
30
30
}
31
31
32
-
Sentry.init({
33
-
dsn: process.env.SENTRY_DSN,
34
-
environment: process.env.NODE_ENV,
35
-
release: process.env.npm_package_version
36
-
})
37
-
38
32
const sentryMiddleware =sentry({
39
-
sentryInstance: Sentry,
33
+
config: {
34
+
dsn: process.env.SENTRY_DSN,
35
+
environment: process.env.NODE_ENV
36
+
},
40
37
withScope: (scope, error, context) => {
41
38
scope.setUser({
42
39
id: context.authorization.userId,
@@ -56,11 +53,31 @@ const server = GraphQLServer({
56
53
serve.start(() =>`Server running on http://localhost:4000`)
57
54
```
58
55
56
+
### Using a Sentry instance
57
+
58
+
In cases where you want to use your own instance of Sentry to use it in other places in your application you can pass the `sentryInstance`. The `config` property should not be passed as an option.
|`withScope`|false|Functiontomodifythe [Sentrycontext](https://docs.sentry.io/enriching-error-data/context/?platform=node) to send with the captured error. |
93
111
|`captureReturnedErrors`|false|Captureerrorsreturnedfromothermiddlewares, e.g., `graphql-shield` [returnserrors](https://github.com/maticzav/graphql-shield#custom-errors) from rules and resolvers |
0 commit comments