Skip to content

Commit

Permalink
Merge pull request #2463 from Urigo/no-asynchooks-docs
Browse files Browse the repository at this point in the history
Update docs #2461
  • Loading branch information
enisdenjo committed Nov 2, 2023
2 parents f3e0750 + b8e2d1d commit e36ba0a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
9 changes: 0 additions & 9 deletions website/src/pages/docs/advanced/execution-context.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,3 @@ The next lines show the usage of `@ExecutionContext` decorator. It's a property
This way the Singleton `Data` service runs within the execution context of a GraphQL Operation and can access Operation scoped Injector and the GraphQL Context object.

It also means you gain a lot in terms of performance because the `Data` class is instantiated only once and used in many operations.

<Callout>
`@ExecutionContext` impacts the performance, depending on your Node version
(execution context uses `async_hooks` module).

GraphQL Modules is smart enough to enable `async_hooks` only when
`@ExecutionContext` is used.

</Callout>
2 changes: 0 additions & 2 deletions website/src/pages/docs/recipes/migration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,6 @@ export class MyProvider {

In v0, we had a concept of Session to manage the execution of each operation. In v1, we dropped it, in favor of a simpler solution.

Internally, we are using Node's `async_hooks` to manage a context of an execution, which allow us to share Injectables between Singleton and Operation scope.

## Context

In v0, you could create a `context` per each module. In v1, `context` is external for GraphQL-Modules and it's not directly in use. You can do whatever you want with that, and just access it in GraphQL-Modules if you need, but we no longer require you to do specific things with your `context`.
Expand Down

0 comments on commit e36ba0a

Please sign in to comment.