Skip to content

Commit 044e45b

Browse files
s1gr1dantonpirker
authored andcommitted
docs(javascript): Add docs for GraphQL Client (#13801)
## DESCRIBE YOUR PR Documents PR getsentry/sentry-javascript#13783 mentioned in issue getsentry/sentry-javascript#13399 closes #13800 ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [ ] Other deadline: <!-- ENTER DATE HERE --> - [ ] 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](https://github.com/orgs/getsentry/teams/docs)
1 parent 891c6de commit 044e45b

File tree

13 files changed

+89
-14
lines changed

13 files changed

+89
-14
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
title: GraphQLClient
3+
description: "Enhance spans and breadcrumbs with data from GraphQL requests."
4+
notSupported:
5+
- javascript.node
6+
- javascript.aws-lambda
7+
- javascript.azure-functions
8+
- javascript.connect
9+
- javascript.express
10+
- javascript.fastify
11+
- javascript.gcp-functions
12+
- javascript.hapi
13+
- javascript.hono
14+
- javascript.koa
15+
- javascript.nestjs
16+
- javascript.deno
17+
- javascript.cloudflare
18+
- javascript.bun
19+
---
20+
21+
<Alert>
22+
23+
This integration only works inside a browser environment.
24+
25+
</Alert>
26+
27+
_Import name: `Sentry.graphqlClientIntegration`_
28+
29+
This integration enhances the data captured from GraphQL requests in your application.
30+
It extracts GraphQL-specific information from HTTP requests matching your configured endpoints and enriches
31+
both spans and breadcrumbs with GraphQL operation details.
32+
33+
When enabled, this integration will:
34+
- Update span names with the GraphQL operation type and name
35+
- Add GraphQL query documents to spans
36+
- Add GraphQL operation information to breadcrumbs
37+
38+
## Options
39+
40+
### `endpoints`
41+
42+
_Type: `(string|RegExp)[]`_
43+
44+
An array of URLs or URL patterns that should be treated as GraphQL endpoints.
45+
The integration will only process requests to these endpoints. This array can contain strings, regular expressions, or a combination of both.
46+
47+
Example:
48+
```javascript
49+
Sentry.init({
50+
integrations: [
51+
Sentry.graphqlClientIntegration({
52+
endpoints: [
53+
'https://graphql-api.example.com',
54+
/\/graphql$/
55+
]
56+
})
57+
]
58+
});
59+
```
60+
61+
To **match all** endpoints with the `graphqlClientIntegration`, you would set the endpoints option to `[/.*/]` in your configuration.
62+
This regex pattern will match any URL.
63+

platform-includes/configuration/integrations/javascript.astro.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Depending on whether an integration enhances the functionality of a particular r
2222
### Browser Integrations
2323

2424
| | **Auto Enabled** | **Errors** | **Tracing** | **Replay** | **Additional Context** |
25-
| ----------------------------------------------------- | :--------------: | :--------: | :---------: | :--------: | :--------------------: |
25+
|-------------------------------------------------------|:----------------:|:----------:|:-----------:|:----------:|:----------------------:|
2626
| [`breadcrumbsIntegration`](./breadcrumbs) || | | ||
2727
| [`browserApiErrorsIntegration`](./browserapierrors) ||| | | |
2828
| [`browserSessionIntegration`](./browsersession) || | | ||
@@ -32,6 +32,7 @@ Depending on whether an integration enhances the functionality of a particular r
3232
| [`browserProfilingIntegration`](./browserprofiling) | | || | |
3333
| [`contextLinesIntegration`](./contextlines) | || | | |
3434
| [`featureFlagsIntegration`](./featureflags) | | | | ||
35+
| [`graphqlClientIntegration`](./graphqlclient) | | | | ||
3536
| [`httpClientIntegration`](./httpclient) | || | | |
3637
| [`launchDarklyIntegration`](./launchdarkly) | | | | ||
3738
| [`moduleMetadataIntegration`](./modulemetadata) | | | | ||

platform-includes/configuration/integrations/javascript.capacitor.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
### Integrations
22

33
| | **Auto Enabled** | **Errors** | **Tracing** | **Replay** | **Additional Context** |
4-
| ----------------------------------------------------- | :--------------: | :--------: | :---------: | :--------: | :--------------------: |
4+
|-------------------------------------------------------|:----------------:|:----------:|:-----------:|:----------:|:----------------------:|
55
| [`breadcrumbsIntegration`](./breadcrumbs) || | | ||
66
| [`browserApiErrorsIntegration`](./browserapierrors) ||| | | |
77
| [`dedupeIntegration`](./dedupe) ||| | | |
@@ -15,6 +15,7 @@
1515
| [`captureConsoleIntegration`](./captureconsole) | | | | ||
1616
| [`contextLinesIntegration`](./contextlines) | || | | |
1717
| [`extraErrorDataIntegration`](./extraerrordata) | | | | ||
18+
| [`graphqlClientIntegration`](./graphqlclient) | | | | ||
1819
| [`httpClientIntegration`](./httpclient) | || | | |
1920
| [`moduleMetadataIntegration`](./modulemetadata) | | | | ||
2021
| [`rewriteFramesIntegration`](./rewriteframes) | || | | |

platform-includes/configuration/integrations/javascript.cordova.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
### Integrations
22

33
| | **Auto Enabled** | **Errors** | **Tracing** | **Replay** | **Additional Context** |
4-
| ----------------------------------------------------- | :--------------: | :--------: | :---------: | :--------: | :--------------------: |
4+
|-------------------------------------------------------|:----------------:|:----------:|:-----------:|:----------:|:----------------------:|
55
| [`breadcrumbsIntegration`](./breadcrumbs) || | | ||
66
| [`browserApiErrorsIntegration`](./browserapierrors) ||| | | |
77
| [`dedupeIntegration`](./dedupe) ||| | | |
@@ -12,6 +12,7 @@
1212
| [`linkedErrorsIntegration`](./linkederrors) ||| | | |
1313
| [`captureConsoleIntegration`](./captureconsole) | | | | ||
1414
| [`extraErrorDataIntegration`](./extraerrordata) | | | | ||
15+
| [`graphqlClientIntegration`](./graphqlclient) | | | | ||
1516
| [`httpClientIntegration`](./httpclient) | || | | |
1617
| [`moduleMetadataIntegration`](./modulemetadata) | | | | ||
1718
| [`rewriteFramesIntegration`](./rewriteframes) | || | | |

platform-includes/configuration/integrations/javascript.gatsby.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
### Integrations
22

33
| | **Auto Enabled** | **Errors** | **Tracing** | **Replay** | **Additional Context** |
4-
| ----------------------------------------------------- | :--------------: | :--------: | :---------: | :--------: | :--------------------: |
4+
|-------------------------------------------------------|:----------------:|:----------:|:-----------:|:----------:|:----------------------:|
55
| [`breadcrumbsIntegration`](./breadcrumbs) || | | ||
66
| [`browserApiErrorsIntegration`](./browserapierrors) ||| | | |
77
| [`dedupeIntegration`](./dedupe) ||| | | |
@@ -16,10 +16,11 @@
1616
| [`captureConsoleIntegration`](./captureconsole) | | | | ||
1717
| [`contextLinesIntegration`](./contextlines) | || | | |
1818
| [`extraErrorDataIntegration`](./extraerrordata) | | | | ||
19+
| [`graphqlClientIntegration`](./graphqlclient) | | | | ||
1920
| [`httpClientIntegration`](./httpclient) | || | | |
2021
| [`moduleMetadataIntegration`](./modulemetadata) | | | | ||
2122
| [`rewriteFramesIntegration`](./rewriteframes) | || | | |
2223
| [`replayIntegration`](./replay) | | | |||
2324
| [`replayCanvasIntegration`](./replaycanvas) | | | || |
2425
| [`reportingObserverIntegration`](./reportingobserver) | || | | |
25-
| [`supabaseIntegration`](./supabase) | ||| | |
26+
| [`supabaseIntegration`](./supabase) | ||| | |

platform-includes/configuration/integrations/javascript.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
### Integrations
22

33
| | **Auto Enabled** | **Errors** | **Tracing** | **Replay** | **Additional Context** |
4-
| ----------------------------------------------------- | :--------------: | :--------: | :---------: | :--------: | :--------------------: |
4+
|-------------------------------------------------------|:----------------:|:----------:|:-----------:|:----------:|:----------------------:|
55
| [`breadcrumbsIntegration`](./breadcrumbs) || | | ||
66
| [`browserApiErrorsIntegration`](./browserapierrors) ||| | | |
77
| [`browserSessionIntegration`](./browsersession) || | | ||
@@ -17,6 +17,7 @@
1717
| [`contextLinesIntegration`](./contextlines) | || | | |
1818
| [`extraErrorDataIntegration`](./extraerrordata) | | | | ||
1919
| [`featureFlagsIntegration`](./featureflags) | | | | ||
20+
| [`graphqlClientIntegration`](./graphqlclient) | | | | ||
2021
| [`httpClientIntegration`](./httpclient) | || | | |
2122
| [`launchDarklyIntegration`](./launchdarkly) | | | | ||
2223
| [`moduleMetadataIntegration`](./modulemetadata) | | | | ||
@@ -26,5 +27,5 @@
2627
| [`reportingObserverIntegration`](./reportingobserver) | || | | |
2728
| [`rewriteFramesIntegration`](./rewriteframes) | || | | |
2829
| [`statsigIntegration`](./statsig) | | | | ||
29-
| [`supabaseIntegration`](./supabase) | ||| | |
30+
| [`supabaseIntegration`](./supabase) | ||| | |
3031
| [`unleashIntegration`](./unleash) | | | | ||

platform-includes/configuration/integrations/javascript.nextjs.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Depending on whether an integration enhances the functionality of a particular r
2222
### Browser Integrations
2323

2424
| | **Auto Enabled** | **Errors** | **Tracing** | **Replay** | **Additional Context** |
25-
| ----------------------------------------------------- | :--------------: | :--------: | :---------: | :--------: | :--------------------: |
25+
|-------------------------------------------------------|:----------------:|:----------:|:-----------:|:----------:|:----------------------:|
2626
| [`breadcrumbsIntegration`](./breadcrumbs) || | | ||
2727
| [`browserApiErrorsIntegration`](./browserapierrors) ||| | | |
2828
| [`browserSessionIntegration`](./browsersession) || | | ||
@@ -32,6 +32,7 @@ Depending on whether an integration enhances the functionality of a particular r
3232
| [`browserProfilingIntegration`](./browserprofiling) | | || | |
3333
| [`contextLinesIntegration`](./contextlines) | || | | |
3434
| [`featureFlagsIntegration`](./featureflags) | | | | ||
35+
| [`graphqlClientIntegration`](./graphqlclient) | | | | ||
3536
| [`httpClientIntegration`](./httpclient) | || | | |
3637
| [`launchDarklyIntegration`](./launchdarkly) | | | | ||
3738
| [`moduleMetadataIntegration`](./modulemetadata) | | | | ||

platform-includes/configuration/integrations/javascript.nuxt.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Depending on whether an integration enhances the functionality of a particular r
2121
### Browser Integrations
2222

2323
| | **Auto Enabled** | **Errors** | **Tracing** | **Replay** | **Additional Context** |
24-
| ----------------------------------------------------- | :--------------: | :--------: | :---------: | :--------: | :--------------------: |
24+
|-------------------------------------------------------|:----------------:|:----------:|:-----------:|:----------:|:----------------------:|
2525
| [`breadcrumbsIntegration`](./breadcrumbs) || | | ||
2626
| [`browserApiErrorsIntegration`](./browserapierrors) ||| | | |
2727
| [`browserSessionIntegration`](./browsersession) || | | ||
@@ -31,6 +31,7 @@ Depending on whether an integration enhances the functionality of a particular r
3131
| [`browserProfilingIntegration`](./browserprofiling) | | || | |
3232
| [`contextLinesIntegration`](./contextlines) | || | | |
3333
| [`featureFlagsIntegration`](./featureflags) | | | | ||
34+
| [`graphqlClientIntegration`](./graphqlclient) | | | | ||
3435
| [`httpClientIntegration`](./httpclient) | || | | |
3536
| [`launchDarklyIntegration`](./launchdarkly) | | | | ||
3637
| [`moduleMetadataIntegration`](./modulemetadata) | | | | ||

platform-includes/configuration/integrations/javascript.remix.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Depending on whether an integration enhances the functionality of a particular r
2121
### Browser Integrations
2222

2323
| | **Auto Enabled** | **Errors** | **Tracing** | **Replay** | **Additional Context** |
24-
| ----------------------------------------------------- | :--------------: | :--------: | :---------: | :--------: | :--------------------: |
24+
|-------------------------------------------------------|:----------------:|:----------:|:-----------:|:----------:|:----------------------:|
2525
| [`breadcrumbsIntegration`](./breadcrumbs) || | | ||
2626
| [`browserApiErrorsIntegration`](./browserapierrors) ||| | | |
2727
| [`browserSessionIntegration`](./browsersession) || | | ||
@@ -31,6 +31,7 @@ Depending on whether an integration enhances the functionality of a particular r
3131
| [`browserProfilingIntegration`](./browserprofiling) | | || | |
3232
| [`contextLinesIntegration`](./contextlines) | || | | |
3333
| [`featureFlagsIntegration`](./featureflags) | | | | ||
34+
| [`graphqlClientIntegration`](./graphqlclient) | | | | ||
3435
| [`httpClientIntegration`](./httpclient) | || | | |
3536
| [`launchDarklyIntegration`](./launchdarkly) | | | | ||
3637
| [`moduleMetadataIntegration`](./modulemetadata) | | | | ||

0 commit comments

Comments
 (0)