0.1.0 • Published 8 years ago

koa-graphdl-middleware v0.1.0

Weekly downloads
2
License
ISC
Repository
github
Last release
8 years ago

Koa Graph-Data-Layer Middleware

Description

This package is an extension of Graph-Data-Layer which makes it easy to expose data-layers from a Koa server.

This makes it possible to fulfill queries from http methods.

Installation

npm install graph-data-layer koa-graphdl-middleware

Usage

/*
* First, initialize your data-layer
* with the schemas you want to expose
*/

import initLayer from 'graph-data-layer';

const layer = initLayer();
layer.register(/* ... */);

/*
* Then, just expose from your app
* with this middleware
*/

import koa from 'koa';
import expose from 'koa-graphdl-middleware';

const app = koa();
app.use(expose(layer));

License

MIT