Skip to content

Commit 3b42fbe

Browse files
committed
docs(javascript): Add docs for GraphQL Client
1 parent be19317 commit 3b42fbe

File tree

1 file changed

+64
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)