Skip to content

Conversation

@philprime
Copy link
Member

@philprime philprime commented Dec 1, 2025

DESCRIBE YOUR PR

This PR adds comprehensive documentation for the enableGraphQLOperationTracking option in the Sentry Cocoa/Apple SDK.

Changes:

  • Created a new dedicated documentation page: graphql-operation-tracking.mdx with detailed information about how GraphQL operation tracking works
  • Updated options.mdx to include the enableGraphQLOperationTracking option with a reference to the dedicated page
  • Updated http-client-errors.mdx to include information about GraphQL operation tracking in failed request events

The documentation explains that when enabled, the SDK extracts GraphQL operation names from HTTP requests (with Content-Type: application/json and an operationName field) and attaches them to:

  • HTTP breadcrumbs as graphql_operation_name (when network breadcrumbs are enabled)
  • Failed request events in the context as graphql.operation_name (when HTTP client error capture is enabled)

This feature is disabled by default (false).

Closes #15606

IS YOUR CHANGE URGENT?

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it.
    Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

@vercel
Copy link

vercel bot commented Dec 1, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
develop-docs Ready Ready Preview Comment Dec 2, 2025 7:09am
sentry-docs Ready Ready Preview Comment Dec 2, 2025 7:09am

@codeowner-assignment codeowner-assignment bot requested a review from a team December 1, 2025 12:39
@codecov
Copy link

codecov bot commented Dec 1, 2025

Bundle Report

Changes will decrease total bundle size by 169.78kB (-0.49%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sentry-docs-server-cjs 23.96MB -169.77kB (-0.7%) ⬇️
sentry-docs-client-array-push 10.22MB -6 bytes (-0.0%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: sentry-docs-client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
static/chunks/pages/_app-*.js -3 bytes 893.1kB -0.0%
static/chunks/9366-*.js -3 bytes 436.99kB -0.0%
static/QxqN6FGZRNiqa0VdKw0Dx/_buildManifest.js (New) 684 bytes 684 bytes 100.0% 🚀
static/QxqN6FGZRNiqa0VdKw0Dx/_ssgManifest.js (New) 77 bytes 77 bytes 100.0% 🚀
static/GOGZD5YBgCnXlL-*.js (Deleted) -684 bytes 0 bytes -100.0% 🗑️
static/GOGZD5YBgCnXlL-*.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️
view changes for bundle: sentry-docs-server-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
1729.js -3 bytes 5.46MB -0.0%
6529.js -3 bytes 4.88MB -0.0%
../instrumentation.js -3 bytes 4.78MB -0.0%
../app/[[...path]]/page.js.nft.json -56.59kB 822.42kB -6.44%
../app/platform-redirect/page.js.nft.json -56.59kB 822.34kB -6.44%
../app/sitemap.xml/route.js.nft.json -56.59kB 819.87kB -6.46%

Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for adding this. I added a few comments. LGTM


When enabled, the SDK extracts the GraphQL operation name from HTTP requests that have `Content-Type: application/json` and contain a JSON body with an `operationName` field. The operation name is then attached to:

- HTTP breadcrumbs as `graphql_operation_name` (when network breadcrumbs are enabled)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

m: I would mention the exact option here enableNetworkBreadcrumbs and link to the options doc page. I just noticed that we don't have enableNetworkBreadcrumbs on https://docs.sentry.io/platforms/apple/guides/ios/configuration/options/ 😅

I think we should also mention that this is enabled by default otherwise it could be confusing.

When enabled, the SDK extracts the GraphQL operation name from HTTP requests that have `Content-Type: application/json` and contain a JSON body with an `operationName` field. The operation name is then attached to:

- HTTP breadcrumbs as `graphql_operation_name` (when network breadcrumbs are enabled)
- Failed request events in the context as `graphql.operation_name` (when HTTP client error capture is enabled)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

### GraphQL Operation Tracking
When `enableGraphQLOperationTracking` is enabled, the SDK extracts the GraphQL operation name from HTTP requests that have `Content-Type: application/json` and contain a JSON body with an `operationName` field. The operation name is then included in the error event's context as `graphql.operation_name`, making it easier to identify which GraphQL operation failed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

m: I think we should link here to docs/platforms/apple/common/configuration/graphql-operation-tracking.mdx

### GraphQL Operation Tracking
When `enableGraphQLOperationTracking` is enabled, the SDK extracts the GraphQL operation name from HTTP requests that have `Content-Type: application/json` and contain a JSON body with an `operationName` field. The operation name is then included in the error event's context as `graphql.operation_name`, making it easier to identify which GraphQL operation failed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l: I think we could be a bit clearer that enableGraphQLOperationTracking is disabled by default.

@philprime philprime merged commit 2644dc1 into master Dec 2, 2025
15 checks passed
@philprime philprime deleted the philprime/graphlq-option branch December 2, 2025 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Apple add docs for graphQL option

4 participants