From a33c828841cad59030bf8556d81c84885f73513d Mon Sep 17 00:00:00 2001 From: Josh GM Walker <56300765+Josh-Walker-GM@users.noreply.github.com> Date: Wed, 6 Mar 2024 09:42:12 +0000 Subject: [PATCH] fix(context): Re-export context from `graphql-server` (#10117) **Problem** As part of v7 context refactoring we move context from `@redwoodjs/graphql-server` to `@redwoodjs/context`. We had a period of time where both locations had the code with the `graphql-server` variant being deprecated. However, once it was removed from `graphql-server` this was a breaking change as any user who had specifically imported from `graphql-server` would now have tp update their code. This reverts this and allows them to continue to import from the `graphql-server` package. **Changes** 1. Re-export the `context` and `setContext` from the package as was done previous to v7. --- CHANGELOG.md | 11 +++++++++++ packages/graphql-server/src/index.ts | 3 +++ 2 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05088f7a20e2..9dee5e373ef8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ ## Unreleased +- fix(context): Re-export context from graphql-server (#10117) + + This change re-exports the `context` and `setContext` properties in + `@redwoodjs/graphql-server` from the `@redwoodjs/context` package + where they are now (as of v7) located. This is done to retroactively + ease the v7 transition and provide a non-breaking rather than a breaking + change. + + See [this forum post](https://community.redwoodjs.com/t/context-imported-from-graphql-server-broken-post-7-0-0/5833) + and the links within for more information on this change. + - fix(scenario): Make sure to clean up scenarios even if tests fail (#10112) Fixes an issue where a unit test failure would cause the scenario cleanup to be skipped. Thanks @peraltafederico and @cjreimer for highlighting this! diff --git a/packages/graphql-server/src/index.ts b/packages/graphql-server/src/index.ts index 756d2abd9af2..95a204909d63 100644 --- a/packages/graphql-server/src/index.ts +++ b/packages/graphql-server/src/index.ts @@ -31,3 +31,6 @@ export { } from './plugins/useRedwoodDirective' export * as rootSchema from './rootSchema' + +// Note: We re-export here for convenience and backwards compatibility +export { context, setContext } from '@redwoodjs/context'