fix(graphql): fix the context not propagated down to resolvers. (#361)

* fix(ctx): fix the context not propagated down to resolvers.

* chore(changeset): add a changeset
pull/362/head
Minghe 2024-01-28 21:00:32 +08:00 committed by GitHub
parent bc23e035e6
commit 2c7b25fc2a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -0,0 +1,5 @@
---
'@hono/graphql-server': patch
---
Fix the context not propagated down to resovlers issue.

View File

@ -133,6 +133,7 @@ export const graphqlServer = <E extends Env = any, P extends string = any, I ext
schema, schema,
document: documentAST, document: documentAST,
rootValue: rootResolver ? await rootResolver(c) : null, rootValue: rootResolver ? await rootResolver(c) : null,
contextValue: c,
variableValues: variables, variableValues: variables,
operationName: operationName, operationName: operationName,
}) })