-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Update GraphQL docs for Java SDK #7647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
cf64bc6
74e7a41
2b175c7
36c155e
eba40ab
ae8e42b
e6b2eff
3d27d77
80d2b74
1959e98
5352f77
e6ecbe3
d5ada5e
ac30cb0
0ec40d3
5f5954e
44148d5
046f63e
0b14140
640de8c
59e3062
a1f5912
6948361
a8ad69c
c2a3c54
4acd04f
95b2f9b
5c63084
41df7ee
0db0edb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -10,109 +10,111 @@ notSupported: | |||||||||||||||
|
|
||||||||||||||||
| Sentry GraphQL integration provides an integration with [GraphQL Java](https://github.com/graphql-java/graphql-java/) through: | ||||||||||||||||
|
|
||||||||||||||||
| - `SentryDataFetcherExceptionHandler` which captures exceptions thrown during data fetcher executions. | ||||||||||||||||
| - `SentryInstrumentation` which creates spans around each data fetcher execution. | ||||||||||||||||
| - `SentryGenericDataFetcherExceptionHandler` which checks for exceptions thrown during data fetcher executions and passes them to `SentryInstrumentation`. | ||||||||||||||||
| - `SentryInstrumentation` which creates spans around each data fetcher execution, captures exceptions and adds breadcrumbs. | ||||||||||||||||
|
|
||||||||||||||||
| If you're using `spring-graphql`, we offer automatic configuration of our GraphQL integration when using our `sentry-spring-boot-starter` or `sentry-spring-boot-jakarta-starter` integrations. | ||||||||||||||||
adinauer marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||||
|
|
||||||||||||||||
| ## Install | ||||||||||||||||
|
|
||||||||||||||||
| ```groovy {tabTitle:Gradle Plugin} | ||||||||||||||||
adinauer marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||
| plugins { | ||||||||||||||||
| id "io.sentry.jvm.gradle" version "{{@inject packages.version('sentry.java.android.gradle-plugin', '3.12.0') }}" | ||||||||||||||||
| } | ||||||||||||||||
| ``` | ||||||||||||||||
|
|
||||||||||||||||
| ```groovy {tabTitle:Gradle} | ||||||||||||||||
| implementation 'io.sentry:sentry-graphql:{{@inject packages.version('sentry.java.graphql', '6.28.0') }}' | ||||||||||||||||
| ``` | ||||||||||||||||
|
|
||||||||||||||||
| ```xml {tabTitle:Maven} | ||||||||||||||||
| <dependency> | ||||||||||||||||
| <groupId>io.sentry</groupId> | ||||||||||||||||
| <artifactId>sentry-graphql</artifactId> | ||||||||||||||||
| <version>{{@inject packages.version('sentry.java.graphql', '5.4.0') }}</version> | ||||||||||||||||
| <version>{{@inject packages.version('sentry.java.graphql', '6.28.0') }}</version> | ||||||||||||||||
| </dependency> | ||||||||||||||||
| ``` | ||||||||||||||||
|
|
||||||||||||||||
| ```groovy {tabTitle:Gradle} | ||||||||||||||||
| implementation 'io.sentry:sentry-graphql:{{@inject packages.version('sentry.java.graphql', '5.4.0') }}' | ||||||||||||||||
| ``` | ||||||||||||||||
|
|
||||||||||||||||
| ```scala {tabTitle: SBT} | ||||||||||||||||
| libraryDependencies += "io.sentry" % "sentry-graphql" % "{{@inject packages.version('sentry.java.graphql', '5.4.0') }}" | ||||||||||||||||
| libraryDependencies += "io.sentry" % "sentry-graphql" % "{{@inject packages.version('sentry.java.graphql', '6.28.0') }}" | ||||||||||||||||
| ``` | ||||||||||||||||
|
|
||||||||||||||||
| For other dependency managers, check out the [central Maven repository](https://search.maven.org/artifact/io.sentry/sentry-graphql). | ||||||||||||||||
|
|
||||||||||||||||
| ## Capture Exceptions | ||||||||||||||||
|
|
||||||||||||||||
| `SentryDataFetcherExceptionHandler` captures the exception, sends it to Sentry, and calls the delegate responsible for handling the exception. | ||||||||||||||||
| ## Setup | ||||||||||||||||
adinauer marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||||
|
|
||||||||||||||||
| Create a new instance of `SentryDataFetcherExceptionHandler`, pass the delegate that handles the exception, and configure `defaultDataFetcherExceptionHandler` when building a `GraphQL` instance: | ||||||||||||||||
| Create a new instance of `SentryGenericDataFetcherExceptionHandler`, pass the delegate that handles the exception, and configure `defaultDataFetcherExceptionHandler` when building a `GraphQL` instance. | ||||||||||||||||
| Create a new instance of `SentryInstrumentation` and configure `instrumentation` when building a `GraphQL` instance. | ||||||||||||||||
| You may want to filter some of the errors by using `beforeSend` or an `EventProcessor` (see <PlatformLink to="/configuration/filtering/">Filters</PlatformLink>). | ||||||||||||||||
|
||||||||||||||||
| Create a new instance of `SentryGenericDataFetcherExceptionHandler`, pass the delegate that handles the exception, and configure `defaultDataFetcherExceptionHandler` when building a `GraphQL` instance. | |
| Create a new instance of `SentryInstrumentation` and configure `instrumentation` when building a `GraphQL` instance. | |
| You may want to filter some of the errors by using `beforeSend` or an `EventProcessor` (see <PlatformLink to="/configuration/filtering/">Filters</PlatformLink>). | |
| - To integrate `GraphQL` through `SentryGenericDataFetcherExceptionHandler`, create a new instance, pass the delegate that handles the exception, then configure `defaultDataFetcherExceptionHandler`. | |
| - To integrate `GraphQL` through `SentryInstrumentation`, create a new instance and configure `instrumentation`. | |
| You may want to filter some of the errors by using `beforeSend` or an `EventProcessor` (read more about <PlatformLink to="/configuration/filtering/">Filters</PlatformLink>). |
In case you're wondering about setup vs set up - Set up is the verb, so when you're telling someone to "Set up a new instance..." vs. setup, which is a noun, so "your setup process..." :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks :-)
Hmm this one I'm not sure about. You need to provide both SentryGenericDataFetcherExceptionHandler and SentryInstrumentation after the latest changes.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| If you've been using the now deprecated `SentryDataFetcherExceptionHandler`, please upgrade to `SentryGenericDataFetcherExceptionHandler` and also make sure `SentryInstrumentation` is configured to have more exceptions captured, more detailed exceptions, breacrumbs and better hub propagation. You may want to filter some of the errors by using `beforeSend` or an `EventProcessor` (see <PlatformLink to="/configuration/filtering/">Filters</PlatformLink>). | |
| The `SentryDataFetcherExceptionHandler` has been deprecated. Please upgrade to `SentryGenericDataFetcherExceptionHandler` and make sure `SentryInstrumentation` is configured to have more exceptions captured, more detailed exceptions, breadcrumbs, and better hub propagation. You may want to filter the errors by using `beforeSend` or an `EventProcessor` (read more about <PlatformLink to="/configuration/filtering/">Filters</PlatformLink>). |
This seems like a daunting list of thing to "make sure of..." do you think it's clear to users why they need to do this and how to do it? If not, maybe we can write a separate section about it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just meant as a side note for people who already used our GraphQL integration before the latest changes. This should put them on the right track to upgrade plus some reasons why in case they missed the changelog entry.
Uh oh!
There was an error while loading. Please reload this page.