Skip to content

Add sample showing how to get HTTP data into the GraphQL context #1

@hameno

Description

@hameno

We need to access some contextual data about the executed GraphQL query in a HttpFilter.
I tried to make use of Context Propagation using a ThreadLocal but it does not seem to be written to (only read).

What am I missing?

Example:

WebGraphQlInterceptor { request, chain ->
        chain.next(request).flatMap { response -> 
            Mono.just(response).contextWrite(Context.of("TEST", "value from response"))
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions