Skip to content

context in SchemaLink is not async #6730

Closed
@elsasslegend

Description

@elsasslegend

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions