Skip to content

async_hooks restricts to only Node.js usage #1697

@PabloSzx

Description

@PabloSzx
Contributor

Right now GraphQL Modules uses a Node.js specific module async_hooks in /packages/graphql-modules/src/application/execution-context.ts, and that restricts the usage of GraphQL Modules to only Node.js, making it harder/impossible to be used in other environments like Deno or Cloudflare workers.

Workaround: In this repo I had to add a no-op for async_hooks to be able to include it in the Cloudflare workers environment

Describe the solution you'd like

Re-factor the current implementation to not require async_hooks

Describe alternatives you've considered

Ship an extra module that doesn't include the async_hooks usage.

Activity

taras

taras commented on Aug 26, 2022

@taras

We recently hit this problem trying to use GraphQL Modules with Deno. We'd love to help with this if possible.

dotansimha

dotansimha commented on Aug 28, 2022

@dotansimha
Member

@kamilkisiela do you think this is something we can find a solution for?

Jinsung-L

Jinsung-L commented on Sep 28, 2022

@Jinsung-L

I'm having the same problem trying to use it in Cloudflare Workers.

kamilkisiela

kamilkisiela commented on Sep 28, 2022

@kamilkisiela
Collaborator

#2255 but I haven't test it anywhere for leaks

Jinsung-L

Jinsung-L commented on Sep 29, 2022

@Jinsung-L
Dan6erbond

Dan6erbond commented on Sep 27, 2023

@Dan6erbond

I'd like to bump this issue as it's the one thing keeping me from migrating to Deno, which would greatly improve the workflow of working with GraphQL and avoiding a whole list of transpilers and bundlers before I have a workable server. Since there hasn't been many updates with Deno's implementation of the async_hooks denoland/deno#7010 can #2255 be considered or a similar implementation?

enisdenjo

enisdenjo commented on Nov 2, 2023

@enisdenjo
Member

Big update, this issue is fixed in graphql-modules@2.2.1 with #2461. Please try it out! Would be happy to hear that we support Deno now too!

self-assigned this
on Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Participants

    @taras@dotansimha@kamilkisiela@PabloSzx@enisdenjo

    Issue actions

      async_hooks restricts to only Node.js usage · Issue #1697 · graphql-hive/graphql-modules