Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

context in SchemaLink is not async #6730

Closed
elsasslegend opened this issue Jul 29, 2020 · 1 comment · Fixed by #6735
Closed

context in SchemaLink is not async #6730

elsasslegend opened this issue Jul 29, 2020 · 1 comment · Fixed by #6735

Comments

@elsasslegend
Copy link

Intended outcome:
I'm trying to have an async context for SchemaLink.
But in "src/link/schema/index.ts" at line 51 there is this.context(operation) instead of await this.context(operation).
This is a different behavior for ApolloClient than for ApolloServer, which breaks the app in my case.

Actual outcome:
context does not wait until promise is resolved, and therefore the injected context in resolvers is wrong.

How to reproduce the issue:
Make the context return a promise instead of a sync function

Versions
Latest version

@benjamn
Copy link
Member

benjamn commented Jul 29, 2020

@djflex68 Seems like a good idea! Have a look at #6735?

@benjamn benjamn self-assigned this Jul 29, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants