open-app-graphql-server
v2.0.1
Published
Server running Secure Scuttlebot over GraphQL.
Downloads
11
Readme
Open App GraphQL Server
A simple server that supports GraphQL schemas as plugins. Made for building apps on top of distributed protocols such as ssb and dat.
Used for an implementation of an Open App Ecosystem of interoperable APIs based on distributed protocols.
Works with Node v8 or higher.
Usage
To try an example simply npm i
&& npm run install-example
and run npm run dev
or yarn dev
to run the example server. Go to http://localhost:4000/graphql to try it out.
To use for your own project simply install with npm i -S open-app-graphq-server
or yarn add open-app-graphq-server
.
const server = require('open-app-graphql-server')
const ssb = require('ssb-graphql-defaults')
const dat = require('dat-graphql')
const economic = require('economic-sentences-graphql')
server([
ssb,
dat,
economic,
])
// Starts a Secure Scuttlebot server and a client that feeds a GraphQL layer
// Use http://localhost:4000/graphql
Blobs
are served from localhost:7777/
using the ssb-serve-blobs plugin. Exmaple:
http://localhost:7777/&AWg5t0YSygakE2Ky9M338qoHC5p4GOqdwFvBU/6MpsY=.sha256
Check out economic-sentences-graphql for an example of how to make a plugin.
Plans
- Schema to deal with
fs
- Have plugins that include not only GraphQL schemas but also
ssb
plugins andflumedb
views.