-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Document Apollo3 GraphQL client errors #7135
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
After the content is reviewed, I will duplicate the content to the Java docs since it can be reused, eg https://docs.sentry.io/platforms/java/performance/instrumentation/apollo3/ |
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.
Good stuff! Left a few notes and suggestions :)
@@ -32,7 +32,8 @@ Add `Interceptors` to `ApolloClient.Builder` using `ApolloBuilderExtensions`: | |||
import com.apollographql.apollo3.ApolloClient; | |||
import io.sentry.apollo3.SentryApolloBuilderExtensionsKt; | |||
|
|||
ApolloClient apollo = SentryApolloBuilderExtensionsKt.sentryTracing(new ApolloClient.Builder()) | |||
ApolloClient apollo = SentryApolloBuilderExtensionsKt |
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.
m
: is there a reason why we use a different snippet here than below?
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.
I just did indentation here, the code already exists, not sure I follow the question.
There's a difference between Kotlin vs Java as well.
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.
Oh right, you only need SentryApolloBuilderExtensionsKt
on Java, and the snippets below are only in Kotlin, sorry for the confusion. Should we add Java snippets for client errors as well?
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.
To be honest, I think we should go Kotlin first and only, less to maintain, nowadays IDEs auto convert the code on copy and paste.
Also, the Apollo3 is designed for KMP, Kotlin first, 90%+ won't be using Kotlin anymore most likely.
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.
That's fair, we could add a section "you can also use this in Java like this: " and the other snippets only in Kotlin. But not necesserily in ths PR
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.
Made some language suggestions.
By default, only GraphQL client errors with a response that includes the [errors](https://spec.graphql.org/October2021/#sec-Errors) array are captured as error events. | ||
|
||
GraphQL client errors from every target (`.*` regular expression) are automatically captured, but you can change this behavior by setting the `failedRequestTargets` option with either a regular expression or a plain `String`. A plain string must contain at least one of the items from the list. Plain strings don't have to be full matches, meaning the URL of a request is matched when it contains a string provided through the option. | ||
|
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.
By default, only GraphQL client errors with a response that includes the [errors](https://spec.graphql.org/October2021/#sec-Errors) array are captured as error events. | |
GraphQL client errors from every target (`.*` regular expression) are automatically captured, but you can change this behavior by setting the `failedRequestTargets` option with either a regular expression or a plain `String`. A plain string must contain at least one of the items from the list. Plain strings don't have to be full matches, meaning the URL of a request is matched when it contains a string provided through the option. | |
By default, only GraphQL client errors with a response that includes the [errors](https://spec.graphql.org/October2021/#sec-Errors) array will be captured as error events. | |
GraphQL client errors from every target (`.*` regular expression) will be automatically captured, but you can change this behavior by setting the `failedRequestTargets` option with either a regular expression or a plain `String`. Plain strings don't have to be full matches – the URL of a request will be matched if it contains a string provided through the option, but a plain string must contain at least one of the items from the list. | |
From the list of errors? Can we specify the list of what please?
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.
failedRequestTargets
is the list provided by the user.
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.
I'm applying the fix for the 1st part, let me know if the 2nd part needs adaption after clarification here https://github.com/getsentry/sentry-docs/pull/7135/files#r1229248641
Co-authored-by: Karl Heinz Struggl <[email protected]>
Co-authored-by: Liza Mock <[email protected]>
Co-authored-by: Liza Mock <[email protected]>
Co-authored-by: Karl Heinz Struggl <[email protected]>
Co-authored-by: Liza Mock <[email protected]>
Co-authored-by: Liza Mock <[email protected]>
Co-authored-by: Karl Heinz Struggl <[email protected]>
Co-authored-by: openapi-getsentry-bot <[email protected]>
Co-authored-by: Vivian Tran <[email protected]>
* add redirects for sourcemaps best practices * add clientdev redirects
* remove link to Apple debug symbols page
Add React Router Info to: *src/wizard/javascript/react/index.md * src/wizard/javascript/react/with-error-monitoring-performance-and-replay.md * src/wizard/javascript/react/with-error-monitoring-and-performance.md
Co-authored-by: Shana Matthews <[email protected]>
@@ -32,7 +32,8 @@ Add `Interceptors` to `ApolloClient.Builder` using `ApolloBuilderExtensions`: | |||
import com.apollographql.apollo3.ApolloClient; | |||
import io.sentry.apollo3.SentryApolloBuilderExtensionsKt; | |||
|
|||
ApolloClient apollo = SentryApolloBuilderExtensionsKt.sentryTracing(new ApolloClient.Builder()) | |||
ApolloClient apollo = SentryApolloBuilderExtensionsKt |
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.
Oh right, you only need SentryApolloBuilderExtensionsKt
on Java, and the snippets below are only in Kotlin, sorry for the confusion. Should we add Java snippets for client errors as well?
Pre-merge checklist
If you work at Sentry, you're able to merge your own PR without review, but please don't unless there's a good reason.
Description of changes
Describe your changes here. If your PR relates to or resolves an issue, add a link to that too.
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.
Extra resources