Skip to content

Add middlewares to implement customizable logic around different stages of query execution #512

Description

@chedom

Add middlewares to implement customizable logic around different stages of query execution.

Use cases:

  • Distributed tracing
  • Gathering metrics (rate/duration per query, in-flight queries, etc)
  • Custom logic before/after query execution (action log, field authorization, etc)

For that purpose I propose to add next middlewares:

  • OperationMiddleware
  • RootFieldMiddleware
  • FieldMiddleware
  • ResponseMiddleware

These middlewares are used in gqlgen.

If this approach is not valid could you advise how to inject custom logic before different stages of query execution ?

If proposed approach is valid I could reopen PR #284 (and add one more with RootFieldMiddleware).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions