Skip to content

Commit

Permalink
fix: udpated the breaking code for graphql-subscriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
abhilash-sivan committed Nov 13, 2024
1 parent 8efb3a0 commit 17f0dbf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/collector/test/tracing/protocols/graphql/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,13 @@ module.exports = function exportSchema() {
},
subscribe: (__, { id }) => {
pinoLogger.warn(`subscribe: ${id}`);
return pubsub.asyncIterator('characterUpdated');

// for graphql-subscriptions/releases version 3, asyncIterator is replaced with asyncIterableIterator
if (pubsub?.asyncIterableIterator) {
return pubsub.asyncIterableIterator('characterUpdated');
} else {
return pubsub.asyncIterator('characterUpdated');
}
}
}
}
Expand Down

0 comments on commit 17f0dbf

Please sign in to comment.