🧘 Rewrite of a fully-featured GraphQL Server with focus on easy setup, performance & great developer experience. The core of Yoga implements WHATWG Fetch API and can run/deploy on any JS environment.
#3237
3324bbab
Thanks @ardatan! - dependencies updates:
@whatwg-node/server@^0.9.33
↗︎
(from ^0.9.32
, in dependencies
)#3237
3324bbab
Thanks @ardatan! - In such environments like CloudFlare Workers, the
request
object in the context always has the initial request object, so it was impossible to
access the actual Request
object from the execution context. Now Yoga ensures that the request
in the context is the same with the actual Request
.
#3251
a8ddac54
Thanks @EmrysMyrddin! - Adds a cache for metrics definition
(Summary, Histogram and Counter).
Fixes an issue preventing this plugin to be initialized multiple times, leading to metrics duplication error (https://github.com/ardatan/graphql-mesh/issues/6545).
Due to Prometheus client API limitations, a metric is only defined once for a given registry. This means that if the configuration of the metrics, it will be silently ignored on plugin re-initialization.
This is to avoid potential loss of metrics data produced between the plugin re-initialization and the last pull by the prometheus agent.
If you need to be sure metrics configuration is up to date after a plugin re-initialization, you can either:
registry.clear()
before plugin re-initialization:
function usePrometheusWithReset() {
registry.clear()
return usePrometheus({ ... })
}
function usePrometheusWithRegistry() {
const registry = new Registry()
return usePrometheus({
registry,
...
})
}
Keep in mind that this implies potential data loss in pull mode.
To ensure metrics from being registered multiple times on the same registry, the signature of
createHistogram
, createSummary
and createCounter
have been changed to now include the
registry as a mandatory parameter.
If you were customizing metrics parameters, you will need to update the metric definitions
usePrometheus({
execute: createHistogram({
+ registry: registry
histogram: new Histogram({
name: 'my_custom_name',
help: 'HELP ME',
labelNames: ['opText'] as const,
- registers: [registry],
}),
fillLabelsFn: () => {}
}),
requestCount: createCounter({
+ registry: registry
histogram: new Histogram({
name: 'my_custom_name',
help: 'HELP ME',
labelNames: ['opText'] as const,
- registers: [registry],
}),
fillLabelsFn: () => {}
}),
requestSummary: createSummary({
+ registry: registry
histogram: new Histogram({
name: 'my_custom_name',
help: 'HELP ME',
labelNames: ['opText'] as const,
- registers: [registry],
}),
fillLabelsFn: () => {}
}),
})
a8ddac54
Thanks @EmrysMyrddin! - dependencies updates:
@envelop/prometheus@^10.0.0
↗︎
(from ^9.4.0
, in dependencies
)3324bbab
,
3324bbab
]:
#3197
f775b341
Thanks @n1ru4l! - Experimental support for aborting GraphQL execution
when the HTTP request is canceled.
The execution of subsequent GraphQL resolvers is now aborted if the incoming HTTP request is canceled from the client side. This reduces the load of your API in case incoming requests with deep GraphQL operation selection sets are canceled.
import { createYoga, useExecutionCancellation } from 'graphql-yoga'
const yoga = createYoga({
plugins: [useExecutionCancellation()]
})
Action Required In order to benefit from this new feature, you need to update your integration setup for Fastify, Koa and Hapi.
- const response = await yoga.handleNodeRequest(req, { ... })
+ const response = await yoga.handleNodeRequestAndResponse(req, res, { ... })
Please refer to the corresponding integration guides for examples.
#3197
f775b341
Thanks @n1ru4l! - dependencies updates:
@graphql-tools/executor@^1.2.5
↗︎
(from ^1.2.2
, in dependencies
)@whatwg-node/fetch@^0.9.17
↗︎
(from ^0.9.7
, in dependencies
)@whatwg-node/server@^0.9.32
↗︎
(from ^0.9.1
, in dependencies
)#3214
f89a1aa2
Thanks @n1ru4l! - Always include empty data payload for final
complete
event of SSE stream responses to ensure
EventSource
compatibility. See
the
GraphQL over SSE protocol
for more information.
f775b341
]:
f775b341
Thanks @n1ru4l! - dependencies updates:
@whatwg-node/fetch@^0.9.17
↗︎
(from ^0.9.7
, in peerDependencies
)f775b341
,
f775b341
,
f89a1aa2
]:
71db7548
Thanks @n1ru4l! - Allow setting async iterable within onParams
hook
setResult
function71db7548
Thanks @n1ru4l! - dependencies updates:
@graphql-tools/executor@^1.2.2
↗︎
(from ^1.0.0
, in dependencies
)@graphql-tools/utils@^10.1.0
↗︎
(from ^10.0.0
, in dependencies
)6725f8e7
Thanks @n1ru4l! - Inject request into extractPersistedOperationId
function for allowing to extract the ID based on request header, query parameters or request path.#3181
35387c04
Thanks @gilgardosh! - Type fix to match
@envelop/response-cache-redis
7dc37e62
Thanks @darren-west! - Removed labels that cause high
cardinality3ef877a7
]:
3ef877a7
]:
3ef877a7
]:
3ef877a7
]:
#3146
d94dd1a0
Thanks @holzerch! - fix: Apply CSRF prevention validation only to
GET requests
Updated dependencies
[3ef877a7
]:
3ef877a7
]:
3ef877a7
]:
3ef877a7
]:
3ef877a7
]:
3ef877a7
]:
3ef877a7
]:
3ef877a7
]:
3ef877a7
]:
3ef877a7
]:
b9d2afcc
Thanks @EmrysMyrddin! - Fix unauthorized error resulting in an
response with 500 status or in a server crash (depending on actual HTTP server implementation
used).b1f0e3a2
]:
b1f0e3a2
Thanks @magrinj! - Adding support of conditionalSchema option.
(Currently without support for WebSocket subscriptions)b1f0e3a2
]:
b1f0e3a2
]:
b1f0e3a2
]:
b1f0e3a2
]:
b1f0e3a2
]:
b1f0e3a2
]:
b1f0e3a2
]:
b1f0e3a2
]:
b1f0e3a2
]:
b1f0e3a2
]:
b1f0e3a2
]:
b1f0e3a2
]:
b1f0e3a2
]:
b1f0e3a2
]: