Skip to content

Commit 7ecbebe

Browse files
authored
chore: cap major supported version of @apollo/server to v4 (#4838)
1 parent c44a3bd commit 7ecbebe

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ updates:
3737
# Packages whose newer versions are not supported by the agent
3838
- dependency-name: "koa-router" # support is >=5.2.0 <14.0.0
3939
- dependency-name: "redis" # support is >=2.0.0 <5
40+
- dependency-name: "@apollo/server" # support is >=4.0.0 <5 so we will ignore any major release
41+
update-types: ["version-update:semver-major"]
4042
groups:
4143
aws-sdk:
4244
dependency-type: "development"

docs/reference/supported-technologies.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ By default transactions are named based on their matched HTTP route if the frame
7373
| --- | --- | --- |
7474
| [express-graphql](https://www.npmjs.com/package/express-graphql) | >=0.6.1 <0.13.0 | Will name all transactions by the GraphQL query name. There is a [known issue with node <10.4](https://github.com/elastic/apm-agent-nodejs/issues/2516). This module is deprecated and is no longer tested. |
7575
| [apollo-server-express](https://www.npmjs.com/package/apollo-server-express) | >=2.0.4 <4 | Will name all transactions by the GraphQL query name. Versions before 2.9.6 are no longer tested. |
76-
| [@apollo/server](https://www.npmjs.com/package/@apollo/server) | >=4.0.0 | Will name all transactions by the GraphQL query name |
76+
| [@apollo/server](https://www.npmjs.com/package/@apollo/server) | >=4.0.0 <5 | Will name all transactions by the GraphQL query name |
7777

7878

7979
## Tracing and Instrumentation [compatibility-tracing-and-instrumentation]

docs/release-notes/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ To check for security updates, go to [Security announcements for the Elastic sta
6060
export ELASTIC_APM_SANITIZE_FIELD_NAMES=password,passwd,pwd,secret,*key,*token*,*session*,*credit*,*card*,*auth*,set-cookie,*principal*,pw,pass,connect.sid
6161
```
6262
63+
### Chores [next-chores]
64+
65+
* Cap the major supported version of `@apollo/server` to v4.
66+
6367
## 4.14.0 [4-14-0]
6468
**Release date:** Sep 25, 2025
6569

lib/instrumentation/modules/@apollo/server.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,22 @@
66

77
'use strict';
88

9+
const semver = require('semver');
910
const shimmer = require('../../shimmer');
1011

11-
module.exports = function (apolloServer, agent, { enabled }) {
12+
module.exports = function (apolloServer, agent, { version, enabled }) {
1213
if (!enabled) {
1314
return apolloServer;
1415
}
1516

17+
if (!semver.satisfies(version, '^4.0.0')) {
18+
agent.logger.debug(
19+
'@apollo/server version %s not supported, skipping @apollo/server instrumentation',
20+
version,
21+
);
22+
return apolloServer;
23+
}
24+
1625
function wrapExecuteHTTPGraphQLRequest(orig) {
1726
return function wrappedExecuteHTTPGraphQLRequest() {
1827
var trans = agent._instrumentation.currTransaction();

0 commit comments

Comments
 (0)