# graphql-plugins

> Plugin-based GraphQL system

Latest version **1.1.0** (published 2019-08-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install graphql-plugins
pnpm add graphql-plugins
yarn add graphql-plugins
bun add graphql-plugins
```

## 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.1.0 |
| Published | 2019-08-14 |
| First published | 2018-07-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 65.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Zoran Ravic |
| Maintainers | zoranravic |
| Keywords | graphql, plugin, plugins, tools, manage, system, oop |

## Links

- npm: https://www.npmjs.com/package/graphql-plugins
- Repository: https://github.com/zoxjs/graphql-plugins
- Homepage: http://zoxjs.com/docs/graphql-intro
- Issues: https://github.com/zoxjs/graphql-plugins/issues
- npm.io page: https://npm.io/package/graphql-plugins

## Alternatives

- [apollo-link-http-common](https://npm.io/package/apollo-link-http-common.md) — 879.0K weekly downloads
- [react-relay](https://npm.io/package/react-relay.md) — 336.8K weekly downloads
- [relay-test-utils](https://npm.io/package/relay-test-utils.md) — 181.6K weekly downloads
- [@vendure/core](https://npm.io/package/@vendure/core.md) — 14.8K weekly downloads
- [@pnpm/deps.graph-sequencer](https://npm.io/package/@pnpm/deps.graph-sequencer.md) — 13.4K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2019-08-14
- 1.0.6 — 2019-08-12
- 1.0.5 — 2019-08-05
- 1.0.4 — 2018-07-13
- 1.0.3 — 2018-07-11
- 1.0.2 — 2018-07-07
- 1.0.1 — 2018-07-07
- 1.0.0 — 2018-07-05

## README

# GraphQL Plugins for Zox.js

```bash
npm i zox zox-plugins graphql-plugins
```

Zox.js was created with one goal in mind: **Making scalable systems**  
And this can easily be achieved using the `graphql-plugins`.

### Resolvers

Easily assign resolvers to fields.

```ts
@Resolver('Post', 'author', PostTypeDefs)
export class AuthorResolver implements IResolver
{
    public handle(source: Post, args, context, info: GraphQLResolveInfo): User
    {
        return users.find(u => u.id == source.user);
    }
}
```

### Top-Level Fields

Declare top-level fields anywhere in your code.

```ts
@Query('user(id: ID!): User', UserDef)
export class UserQuery extends ResolverBase
{
    public resolve(root, args, context): Array<UserData>
    {
        return users.find(u => u.id == args.id);
    }
}
```

### Subscriptions

Use Event Emitters as GraphQL Subscription endpoints
that can be accessed over a Web Socket.

```ts
@Subscription('post: Post', PostTypeDefs)
export class PostSubscription extends SubscriptionEventResolverBase
{
    public eventNames: Array<string> = [postCreated, postUpdates, postDeleted];
    public eventEmitter: EventEmitter = eventEmitter;
}
```

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