Title: GraphQL ignored-error-types should not rely only on ErrorClassification.toString() · Issue #6020 · getsentry/sentry-java · GitHub
Open Graph Title: GraphQL ignored-error-types should not rely only on ErrorClassification.toString() · Issue #6020 · getsentry/sentry-java
X Title: GraphQL ignored-error-types should not rely only on ErrorClassification.toString() · Issue #6020 · getsentry/sentry-java
Description: Problem Statement I am using the GraphQL integration with: io.sentry:sentry-spring-boot-4 io.sentry:sentry-graphql-22 Sentry Java SDK 8.42.0 com.graphql-java:graphql-java-extended-validation:24.0 I want to ignore expected GraphQL validat...
Open Graph Description: Problem Statement I am using the GraphQL integration with: io.sentry:sentry-spring-boot-4 io.sentry:sentry-graphql-22 Sentry Java SDK 8.42.0 com.graphql-java:graphql-java-extended-validation:24.0 I...
X Description: Problem Statement I am using the GraphQL integration with: io.sentry:sentry-spring-boot-4 io.sentry:sentry-graphql-22 Sentry Java SDK 8.42.0 com.graphql-java:graphql-java-extended-validation:24.0 I...
Opengraph URL: https://github.com/getsentry/sentry-java/issues/6020
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"GraphQL ignored-error-types should not rely only on ErrorClassification.toString()","articleBody":"### Problem Statement\n\nI am using the GraphQL integration with:\n\n- `io.sentry:sentry-spring-boot-4`\n- `io.sentry:sentry-graphql-22`\n- Sentry Java SDK `8.42.0`\n- `com.graphql-java:graphql-java-extended-validation:24.0`\n\nI want to ignore expected GraphQL validation errors produced by `graphql-java-extended-validation`.\n\nThe configuration looks like this:\n\n```yaml\nsentry.graphql.ignored-error-types:\n - BAD_REQUEST\n - UNAUTHORIZED\n - FORBIDDEN\n - NOT_FOUND\n - ExtendedValidationError\n```\n\nThis works well for enum-like ErrorClassification values, but it does not work reliably for errors from graphql-java-extended-validation.\nFrom what I can see, SentryGraphqlInstrumentation currently resolves the error type with:\n\n```java\nerror.getErrorType().toString()\n```\n\nand then compares that string with ignoredErrorTypes.\nThe problem is that graphql-java-extended-validation uses a private ResourceBundleMessageInterpolator.ValidationErrorType class. It does not expose a stable enum-like value via toString(). The semantic classification is exposed through ErrorClassification.toSpecification(...), which returns a map like:\n\n```java\n{\n \"type\": \"ExtendedValidationError\",\n \"validatedPath\": [...],\n \"constraint\": \"@...\"\n}\n```\n\nBecause of this, I currently have to work around the issue by replacing the extended-validation MessageInterpolator and returning a custom ErrorClassification whose toString() returns ExtendedValidationError only when called from Sentry:\n\n```java\noverride fun toString(): String {\n if (stackWalker.callerClass == SentryGraphqlInstrumentation::class.java) {\n return \"ExtendedValidationError\"\n }\n\n return super.toString()\n}\n```\n\nThat workaround is brittle and depends on Sentry internals.\nThis looks related to #2899, which added easier GraphQL error filtering. The current string-based filtering solves enum-like classifications, but it is hard to use with custom ErrorClassification implementations where toSpecification(...) carries the meaningful classification.\n\n\n### Solution Brainstorm\n\nCould Sentry support a more robust way to classify ignored GraphQL errors?\n\nA few possible approaches:\n\n1. When `error.getErrorType()` is present, call `errorType.toSpecification(error)` and, if it returns a map containing a `type` field, allow `ignored-error-types` to match that value.\n\n2. Add a callback/predicate for GraphQL errors. This would allow applications to inspect GraphQLError, ErrorClassification, extensions, path, etc.\n3. Pass the GraphQLError and/or ErrorClassification through the Sentry Hint, as mentioned in #2899, so users can filter these events in beforeSend without replacing the whole GraphQL instrumentation.\n\nMy preference would be option 1 for configuration compatibility, possibly combined with option 3 for advanced filtering.\n\nThis would also make the Sentry GraphQL integration work out of the box with `graphql-java-extended-validation`, which is an official companion library from the `graphql-java` project. Since Sentry Java already integrates with `graphql-java`, it would be helpful if expected validation errors from this commonly used library could be ignored without replacing the message interpolator or depending on `ErrorClassification.toString()`.","author":{"url":"https://github.com/arturs678","@type":"Person","name":"arturs678"},"datePublished":"2026-08-27T13:04:05Z","url":"https://github.com/getsentry/sentry-java/issues/6020"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:aab875c3-9f11-a347-72d2-6085290ba3c6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B264:14AF70:C717B:110A7A:6B046374 |
| html-safe-nonce | e9c15c18679b90e8374efa2818b7f84b9391b9a18ace979af4af2b7a13f7e12a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMjY0OjE0QUY3MDpDNzE3QjoxMTBBN0E6NkIwNDYzNzQiLCJ2aXNpdG9yX2lkIjoiMTgyNzg0Njk2NTI0MTg2NTA3NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 588eea4e4a47372bae2423db9bc56803603828c65ceda27b5d6a001da2677ff2 |
| hovercard-subject-tag | issue:5267836640 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-java/6020/issue_layout |
| twitter:image | https://opengraph.githubassets.com/10b801b587db27fb43cab0dd3b8fbb952111dc9fbf734ccb60a9513059ed0701/getsentry/sentry-java/issues/6020 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/10b801b587db27fb43cab0dd3b8fbb952111dc9fbf734ccb60a9513059ed0701/getsentry/sentry-java/issues/6020 |
| og:image:alt | Problem Statement I am using the GraphQL integration with: io.sentry:sentry-spring-boot-4 io.sentry:sentry-graphql-22 Sentry Java SDK 8.42.0 com.graphql-java:graphql-java-extended-validation:24.0 I... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | arturs678 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2d58451b4bcb73c33c67bfb6b28fb75fe6d5e279daf9b560fa4fd832f3d8c9a6 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-java git https://github.com/getsentry/sentry-java.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3368190 |
| octolytics-dimension-repository_nwo | getsentry/sentry-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3368190 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 03e114520787ad27289207f153520ef97461127c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width