Skip to content

Async derived context values #204

@louy

Description

@louy

Hi,

One of the major limitations of the derived context values feature is that derived value functions have to be synchronous, or the consumer has to await each value.

In most cases where the feature would have been usable, this has prevented us from using it, because most of our context-dervied values are async.

Examples:

  • Database connection (async since we acquire a connection from a pool for each resolver, otherwise we use a singleton)
  • User or other request-related records (permissions, organisation/tenant, etc)
  • Database transaction (similar to above, more niche)

It would be great if grats can detect and await any functions that generate @gqlContext-tagged value that just happen to be async.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions