Skip to content

Not possible to update context inside hooks #840

Open
@Hades32

Description

@Hades32

As the current hook signature is func beforeHook(ctx context.Context, resource string, operationName string) error (and after hook even slimmer), it is only possible to read but not possible to write (without hacks) to the context.

Before starting a PR: Is there a reason why the signature is not func beforeHook(ctx context.Context, resource string, operationName string) (newCtx ctx context.Context, err error)?

I understand this would be a breaking change, but without this, the context use-case is pretty limited...

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