March 05, 2025
@graphql-yoga/apollo-link@3.13.0
@graphql-yoga/urql-exchange@3.13.0
graphql-yoga@5.13.0
Minor Changes
-
#3793
63b78d5
Thanks @EmrysMyrddin! - Add new Instruments APIIntroduction of a new API allowing to instrument the graphql pipeline.
This new API differs from already existing Hooks by not having access to input/output of phases.
The goal ofInstruments
is to run allow running code before, after or around the whole process
of a phase, including plugins hooks executions.The main use case of this new API is observability (monitoring, tracing, etc...).
Basic usage
import { createYoga } from 'graphql-yoga' import Sentry from '@sentry/node' import schema from './schema' const server = createYoga({ schema, plugins: [ { instruments: { request: ({ request }, wrapped) => Sentry.startSpan({ name: 'Graphql Operation' }, async () => { try { await wrapped() } catch (err) { Sentry.captureException(err) } }) } } ] })
Multiple instruments plugins
It is possible to have multiple instruments plugins (Prometheus and Sentry for example), they will
be automatically composed by envelop in the same order than the plugin array (first is outermost,
last is inner most).import { createYoga } from 'graphql-yoga' import schema from './schema' const server = createYoga({ schema, plugins: [useSentry(), useOpentelemetry()] })
sequenceDiagram Sentry->>Opentelemetry: ; Opentelemetry->>Server Adapter: ; Server Adapter->>Opentelemetry: ; Opentelemetry->>Sentry: ;
Custom instruments ordering
If the default composition ordering doesn't suite your need, you can manually compose instruments.
This allows to have a different execution order of hooks and instruments.import { composeInstruments, createYoga } from 'graphql-yoga' import schema from './schema' const { instruments: sentryInstruments, ...sentryPlugin } = useSentry() const { instruments: otelInstruments, ...otelPlugin } = useOpentelemetry() const instruments = composeInstruments([otelInstruments, sentryInstruments]) const server = createYoga({ schema, plugins: [{ instruments }, useSentry(), useOpentelemetry()] })
sequenceDiagram Opentelemetry->>Sentry: ; Sentry->>Server Adapter: ; Server Adapter->>Sentry: ; Sentry->>Opentelemetry: ;
Patch Changes
-
#3793
63b78d5
Thanks @EmrysMyrddin! - dependencies updates:- Updated dependency
@envelop/core@^5.2.1
↗︎ (from
^5.0.2
, independencies
) - Added dependency
@envelop/instruments@^1.0.0
↗︎
(todependencies
) - Added dependency
@whatwg-node/promise-helpers@^1.2.4
↗︎
(todependencies
)
- Updated dependency
-
#3855
6ed67e8
Thanks @renovate! - dependencies updates:- Updated dependency
@whatwg-node/server@^0.10.0
↗︎
(from^0.9.71
, independencies
)
- Updated dependency
@graphql-yoga/nestjs@3.13.0
Patch Changes
@graphql-yoga/nestjs-federation@3.13.0
Patch Changes
- #3793
63b78d5
Thanks @EmrysMyrddin! - dependencies updates:- Updated dependency
@envelop/apollo-federation@^6.1.1
↗︎
(from^6.0.0
, independencies
) - Updated dependency
@envelop/core@^5.2.1
↗︎ (from
^5.0.0
, independencies
)
- Updated dependency
- Updated dependencies
[63b78d5
]:- @graphql-yoga/plugin-apollo-inline-trace@3.13.0
- @graphql-yoga/nestjs@3.13.0
@graphql-yoga/plugin-apollo-inline-trace@3.13.0
Patch Changes
- #3793
63b78d5
Thanks @EmrysMyrddin! - dependencies updates:- Updated dependency
@envelop/on-resolve@^5.1.1
↗︎
(from^5.0.0
, independencies
)
- Updated dependency
- Updated dependencies
[63b78d5
,
63b78d5
,
6ed67e8
]:- graphql-yoga@5.13.0
@graphql-yoga/apollo-managed-federation@0.11.0
Patch Changes
@graphql-yoga/plugin-apollo-usage-report@0.8.0
Patch Changes
- Updated dependencies
[63b78d5
,
63b78d5
,
63b78d5
,
6ed67e8
]:- @graphql-yoga/plugin-apollo-inline-trace@3.13.0
- graphql-yoga@5.13.0
@graphql-yoga/plugin-apq@3.13.0
Patch Changes
@graphql-yoga/plugin-csrf-prevention@3.13.0
Patch Changes
@graphql-yoga/plugin-defer-stream@3.13.0
Patch Changes
@graphql-yoga/plugin-disable-introspection@2.14.0
Patch Changes
- #3793
63b78d5
Thanks @EmrysMyrddin! - dependencies updates:- Added dependency
@whatwg-node/promise-helpers@^1.2.4
↗︎
(todependencies
)
- Added dependency
- Updated dependencies
[63b78d5
,
63b78d5
,
6ed67e8
]:- graphql-yoga@5.13.0
@graphql-yoga/plugin-graphql-sse@3.13.0
Patch Changes
@graphql-yoga/plugin-jwt@3.7.0
Patch Changes
@graphql-yoga/plugin-persisted-operations@3.13.0
Patch Changes
@graphql-yoga/plugin-prometheus@6.8.0
Patch Changes
- #3793
63b78d5
Thanks @EmrysMyrddin! - dependencies updates:- Updated dependency
@envelop/prometheus@^12.1.1
↗︎
(from^12.0.0
, independencies
)
- Updated dependency
- Updated dependencies
[63b78d5
,
63b78d5
,
6ed67e8
]:- graphql-yoga@5.13.0
@graphql-yoga/plugin-response-cache@3.15.0
Patch Changes
- #3793
63b78d5
Thanks @EmrysMyrddin! - dependencies updates:- Updated dependency
@envelop/core@^5.2.1
↗︎ (from
^5.0.2
, independencies
) - Updated dependency
@envelop/response-cache@^7.1.1
↗︎
(from^7.0.0
, independencies
)
- Updated dependency
- Updated dependencies
[63b78d5
,
63b78d5
,
6ed67e8
]:- graphql-yoga@5.13.0