# postgraphile-callback-plugin

> You can pass callback functions to this plugin, which'll then be called when specific postgraphile hooks are triggered. Right now, it only works for postgraphile:http:handler and postgraphile:http:end. The ability to pass such callbacks are useful for log

Latest version **0.1.5** (published 2021-01-14) · UNLICENSED license · 0 weekly downloads

## Install

```sh
npm install postgraphile-callback-plugin
pnpm add postgraphile-callback-plugin
yarn add postgraphile-callback-plugin
bun add postgraphile-callback-plugin
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.5 |
| Published | 2021-01-14 |
| First published | 2019-01-29 |
| Weekly downloads | 0 |
| License | UNLICENSED |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Rune AI Inc. |
| Maintainers | bfelbo |

## Links

- npm: https://www.npmjs.com/package/postgraphile-callback-plugin
- Repository: https://github.com/RuneAI/postgraphile-callback-plugin
- Homepage: https://github.com/RuneAI/postgraphile-callback-plugin#readme
- Issues: https://github.com/RuneAI/postgraphile-callback-plugin/issues
- npm.io page: https://npm.io/package/postgraphile-callback-plugin

## Dependencies (2)

- [postgraphile](https://npm.io/package/postgraphile.md) ^4.2.0
- [graphile-utils](https://npm.io/package/graphile-utils.md) ^4.2.1

## Recent versions

- 0.1.5 (latest) — 2021-01-14
- 0.1.4 — 2021-01-14
- 0.1.3 — 2021-01-13
- 0.1.0 — 2019-01-29

## README

# postgraphile-callback-plugin
You can pass callback functions to this plugin, which'll then be called when specific postgraphile hooks are triggered. The ability to pass such callbacks are useful for logging and many other things.

Right now, it only works for postgraphile:http:handler and postgraphile:http:end, which are called respectively when a GraphQL request is received and a result is just about to be sent back.

Use as:

```
const { postgraphile, makePluginHook } = require("postgraphile")
const { default: callbackPlugin } = require("postgraphile-callback-plugin")

const graphilePluginHook = makePluginHook([
  callbackPlugin
])

const graphileOpt = {
  pluginHook: graphilePluginHook,
  startCallbackFunction: myStartCallbackFunction,
  endCallbackFunction: myEndCallbackFunction}

postgraphile(pool, ["mySchema"], graphileOpt)
```

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