Skip to content

Commit

Permalink
fix(context): Re-export context from graphql-server (#10117)
Browse files Browse the repository at this point in the history
**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.
  • Loading branch information
Josh-Walker-GM authored Mar 6, 2024
1 parent e9ecbb0 commit e240f9e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!

Expand Down
3 changes: 3 additions & 0 deletions packages/graphql-server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'

0 comments on commit e240f9e

Please sign in to comment.