Open pablocompagni-contractorvp opened 1 year ago
I'm encountering this issue for our graphql subscriptions. It seems onExecute
isnt called when executing a graphql subscription, but the onResolve
function is still being called for the subscription field.
Also heads up that the link in the codebase for this plugin is not available any longer (https://github.com/apollographql/apollo-server/blob/main/packages/apollo-tracing/src/index.ts)
Yes, it seems that this plugin was not made with subscriptions in mind.
Th fix would be to replicate the logic of the onExecute
hook in the onSubscribe
hook.
Since subscriptions and simple queries are not using the same executor in graphql-js
, Envelop offers 2 seperated hooks for the tow kind of operations.
Issue workflow progress
Progress of the issue based on the Contributor Workflow
@envelop/*
packages that you are using.Describe the bug
I get following error when I include apollo-tracing:
Cannot read properties of undefined (reading 'hrtime')
Here's the more complete stack trace:
It seems to be failling here, with ctx being undefined for some reason.
This is an ESM nodejs project, in case it matters.
Environment: