Per-request context enrichment.
An enricher is a fn / protocol impl that runs once per GraphQL operation before validators and the backend chain. It receives the current request ctx (headers plus any values added by earlier enrichers) and returns a map of new values to merge in.
Typical use case in a Spring Boot app: pull the customer / equipment identifiers out of Redis using the JWT subject, so every step and validator downstream can read them from ctx without repeating the lookup.
Enrichers are supplied to bff.core/create-handler as an ordered
sequence; each sees the accumulated ctx from earlier enrichers.
Per-request context enrichment. An enricher is a fn / protocol impl that runs once per GraphQL operation before validators and the backend chain. It receives the current request ctx (headers plus any values added by earlier enrichers) and returns a map of new values to merge in. Typical use case in a Spring Boot app: pull the customer / equipment identifiers out of Redis using the JWT subject, so every step and validator downstream can read them from ctx without repeating the lookup. Enrichers are supplied to `bff.core/create-handler` as an ordered sequence; each sees the accumulated ctx from earlier enrichers.
(enrich this ctx)Return a map of additional key/value pairs to merge into ctx, or nil to leave ctx unchanged.
Return a map of additional key/value pairs to merge into ctx, or nil to leave ctx unchanged.
(enrich-ctx ctx enrichers)Fold enrichers (an ordered seq) over ctx. An enricher's return value
is merged into the accumulated ctx; nil or a non-map return is ignored.
Fold `enrichers` (an ordered seq) over `ctx`. An enricher's return value is merged into the accumulated ctx; nil or a non-map return is ignored.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |