Skip to content

May 08, 2024

Latest
Compare
Choose a tag to compare
@theguild-bot theguild-bot released this 08 May 09:18
· 28 commits to main since this release
f99322f

graphql-yoga-cloud-run-guide@3.3.1

Patch Changes

@graphql-yoga/apollo-link@3.3.1

@graphql-yoga/urql-exchange@3.3.1

graphql-yoga@5.3.1

Patch Changes

  • #3237
    3324bbab
    Thanks @ardatan! - dependencies updates:

  • #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.

@graphql-yoga/nestjs@3.3.1

Patch Changes

@graphql-yoga/nestjs-federation@3.3.1

Patch Changes

  • Updated dependencies []:
    • @graphql-yoga/nestjs@3.3.1
    • @graphql-yoga/plugin-apollo-inline-trace@3.3.1

@graphql-yoga/plugin-apollo-inline-trace@3.3.1

Patch Changes

@graphql-yoga/plugin-apq@3.3.1

Patch Changes

@graphql-yoga/plugin-csrf-prevention@3.3.1

Patch Changes

@graphql-yoga/plugin-defer-stream@3.3.1

Patch Changes

@graphql-yoga/plugin-disable-introspection@2.3.1

Patch Changes

@graphql-yoga/plugin-graphql-sse@3.3.1

Patch Changes

@graphql-yoga/plugin-jwt@2.3.1

Patch Changes

@graphql-yoga/plugin-persisted-operations@3.3.1

Patch Changes

@graphql-yoga/plugin-prometheus@5.0.0

Major Changes

  • #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 (ardatan/graphql-mesh#6545).

    Behavior Breaking Change:

    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:

    • restart the whole node process instead of just recreating a graphql server at runtime
    • clear the registry using registry.clear() before plugin re-initialization:
      function usePrometheusWithReset() {
        registry.clear()
        return usePrometheus({ ... })
      }
    • use a new registry for each plugin instance:
      function usePrometheusWithRegistry() {
        const registry = new Registry()
        return usePrometheus({
          registry,
          ...
        })
      }

    Keep in mind that this implies potential data loss in pull mode.

    API Breaking Change:

    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: () => {}
      }),
    })

Patch Changes

@graphql-yoga/plugin-response-cache@3.5.1

Patch Changes

@graphql-yoga/plugin-sofa@3.3.1

Patch Changes

@graphql-yoga/render-graphiql@5.3.1

Patch Changes