# graphql-factory-plugin

> Base class for GraphQL Factory plugin

Latest version **0.2.0** (published 2017-10-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install graphql-factory-plugin
pnpm add graphql-factory-plugin
yarn add graphql-factory-plugin
bun add graphql-factory-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.2.0 |
| Published | 2017-10-23 |
| First published | 2017-10-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Branden Horiuchi |
| Maintainers | vbranden |

## Links

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

## Recent versions

- 0.2.0 (latest) — 2017-10-23
- 0.1.0 — 2017-10-20

## README

# graphql-factory-plugin
Base class for GraphQL Factory plugins

### Description

All GraphQL Factory plugins should extend this class.

### Example

```js
import FactoryPlugin from 'graphql-factory-plugin'

export default class MyPlugin extends FactoryPlugin {
  constructor () {
    const context = {
      foo: 'bar'
    }
    super('MyPlugin', context)
  }
  
  install (definition) {
    definition.before(...)
  }
}

```

### Constructor

The constructor takes the following arguments

* `name` - Unique plugin name. Required
* [`context`] - Optional context object to assign into the main context
* [`functions`] - Optional functions hash
* [`types`] - Optional type definitions hash
* [`schemas`] - Optional schema definitions hash

### Install

The install method should be overridden when necessary. An example would be to register
`before`, `after`, or `error` middleware as well as registering dependent plugins.

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