Skip to content

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jul 2, 2025

Bumps graphql-yoga from 5.13.5 to 5.14.0.

Changelog

Sourced from graphql-yoga's changelog.

5.14.0

Minor Changes

  • #4088 98c82a5 Thanks @​EmrysMyrddin! - Added new withState plugin utility for easy data sharing between hooks.

    New plugin utility to ease data sharing between hooks

    Sometimes, plugins can grow in complexity and need to share data between its hooks.

    A way to solve this can be to mutate the graphql context, but this context is not always available in all hooks in Yoga or Hive Gateway plugins. Moreover, mutating the context gives access to your internal data to all other plugins and graphql resolvers, without mentioning performance impact on field access on this object.

    The recommended approach to this problem was to use a WeakMap with a stable key (often the context or request object). While it works, it's not very convenient for plugin developers, and is prone to error with the choice of key.

    The new withState utility solves this DX issue by providing an easy and straightforward API for data sharing between hooks.

    import { withState } from 'graphql-yoga'
    type State = { foo: string }
    const myPlugin = () =>
    withState<Plugin, State>(() => ({
    onParse({ state }) {
    state.forOperation.foo = 'foo'
    },
    onValidate({ state }) {
    const { foo } = state.forOperation
    console.log('foo', foo)
    }
    }))

    The state payload field will be available in all relevant hooks, making it easy to access shared data. It also forces the developer to choose the scope for the data:

    • forOperation for a data scoped to GraphQL operation (Envelop, Yoga and Hive Gateway)
    • forRequest for a data scoped to HTTP request (Yoga and Hive Gateway)
    • forSubgraphExecution for a data scoped to the subgraph execution (Hive Gateway)

    Not all scopes are available in all hooks, the type reflects which scopes are available

... (truncated)

Commits
  • 4aad787 chore(release): update monorepo packages versions (#4064)
  • 4dfdc38 fix(deps): update all non-major dependencies (#4095)
  • 6e04a7f fix(deps): update envelop (major) (#4087)
  • 98c82a5 feat(graphql-yoga): Add new withState plugin util (#4088)
  • 3fa32de fix(ci): downgrade jest to version 29 (#4096)
  • 3d88429 fix(deps): update all non-major dependencies (#4094)
  • eec82d9 fix(deps): update all non-major dependencies (#4078)
  • 1a5f4cb chore(deps): update jest monorepo to v30 (major) (#4083)
  • 5f75a42 Inherit GraphQL error extensions when it's wrapping an internal server error ...
  • cc8023d fix(deps): update all non-major dependencies (#4066)
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [graphql-yoga](https://github.com/graphql-hive/graphql-yoga/tree/HEAD/packages/graphql-yoga) from 5.13.5 to 5.14.0.
- [Release notes](https://github.com/graphql-hive/graphql-yoga/releases)
- [Changelog](https://github.com/graphql-hive/graphql-yoga/blob/main/packages/graphql-yoga/CHANGELOG.md)
- [Commits](https://github.com/graphql-hive/graphql-yoga/commits/graphql-yoga@5.14.0/packages/graphql-yoga)

---
updated-dependencies:
- dependency-name: graphql-yoga
  dependency-version: 5.14.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code labels Jul 2, 2025
@karianna karianna merged commit 156e51f into master Jul 2, 2025
1 check passed
@dependabot dependabot bot deleted the dependabot/npm_and_yarn/graphql-yoga-5.14.0 branch July 2, 2025 02:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants