You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, I'm really enjoying using Hono - great job on speed and simplicity 👏. I initially started with plain REST, but then moved on to using GraphQL using the middleware you provide. Pothos is a type safe GraphQL schema builder which I'd really like to use together with Hono, but I'm having some issues trying to get them to work together.
Context Propagation
I can get the context from the pipeline to go to a root resolver, but not to go to individual resolvers, e.g. for mutations.
When I try to use authScopes for resolvers, the GraphQL processing returns this error: "Invalid value used as weak map key". I raised an issue in the Pothos repo here: Hono / Pothos scopes integration error hayes/pothos#1064, and the author thinks it's related to propagating the context object, so if 1 is solved, then this should be solved also.
It would be nice to opt out of the GraphQL error handling, e.g. by returning a plain old 401 http code, but everything gets wrapped in a GraphQL error. Not sure if there's anything that can be done about this.
I'm using Cloudflare Workers and it's not trivial to get everything up and running, so I have created a full repro of these issues, along with tests that demonstrate them at this repo: https://github.com/armstrong-pv/hono-pothos-issue-repro
Full repro, including tests located here: https://github.com/armstrong-pv/hono-pothos-issue-repro
First of all, I'm really enjoying using Hono - great job on speed and simplicity 👏. I initially started with plain REST, but then moved on to using GraphQL using the middleware you provide. Pothos is a type safe GraphQL schema builder which I'd really like to use together with Hono, but I'm having some issues trying to get them to work together.
I can get the context from the pipeline to go to a root resolver, but not to go to individual resolvers, e.g. for mutations.
authScopes
for resolvers, the GraphQL processing returns this error: "Invalid value used as weak map key". I raised an issue in the Pothos repo here: Hono / Pothos scopes integration error hayes/pothos#1064, and the author thinks it's related to propagating the context object, so if 1 is solved, then this should be solved also.I'm using Cloudflare Workers and it's not trivial to get everything up and running, so I have created a full repro of these issues, along with tests that demonstrate them at this repo: https://github.com/armstrong-pv/hono-pothos-issue-repro
There is a readme which covers setting everything up and running the tests: https://github.com/armstrong-pv/hono-pothos-issue-repro/blob/main/README.md.
It's pretty straightforward:
If you want to run in dev mode:
Many thanks!
The text was updated successfully, but these errors were encountered: