# exegesis-plugin-context

> An exegesis plugin to add a extra values to the request context

Latest version **1.0.3** (published 2021-05-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install exegesis-plugin-context
pnpm add exegesis-plugin-context
yarn add exegesis-plugin-context
bun add exegesis-plugin-context
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2021-05-09 |
| First published | 2019-02-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 0 |
| Unpacked size | 23.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Phil Mitchell |
| Maintainers | phil-mitchell |

## Links

- npm: https://www.npmjs.com/package/exegesis-plugin-context
- Repository: https://github.com/phil-mitchell/exegesis-plugin-context
- Homepage: https://github.com/phil-mitchell/exegesis-plugin-context#readme
- Issues: https://github.com/phil-mitchell/exegesis-plugin-context/issues
- npm.io page: https://npm.io/package/exegesis-plugin-context

## Recent versions

- 1.0.3 (latest) — 2021-05-09
- 1.0.2 — 2020-02-01
- 1.0.1 — 2019-08-17
- 1.0.0 — 2019-02-10

## README

# exegesis-plugin-context

[![Run Status](https://api.shippable.com/projects/5c60aaf93adda8070010b003/badge?branch=master)]()
[![Coverage Badge](https://api.shippable.com/projects/5c60aaf93adda8070010b003/coverageBadge?branch=master)]()
![](https://img.shields.io/github/issues/phil-mitchell/exegesis-plugin-context.svg)
![](https://img.shields.io/github/license/phil-mitchell/exegesis-plugin-context.svg)
![](https://img.shields.io/node/v/exegesis-plugin-context.svg)

## Description

An exegesis plugin to add a extra values to the request context

## Installation

```sh
npm install exegesis-plugin-context
```

## Example

Add this to your Exegesis options:

```js
const exegesisContext = require( 'exegesis-plugin-context' );
const MyDataStore = require( './MyDataStore' );

var dataStore = new MyDataStore();

options = {
    plugins: [
        exegesisContext({
            dataStore: dataStore
        })
    ]
};
```

Within the handler for each operation you can access the provided values via the extraContext property:

```js
async function myOperationHandler( context ) {
    return context.extraContext.dataStore.findItemsForRequest( context );
}
```

This is added during the postRouting phase so it is also available within authenticators.

---
_Source: https://npm.io/package/exegesis-plugin-context · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
