@shopify/libra-rpc-graphql-server
v0.1.0
Published
Libra GraphQL Playground Apollo server running on express
Downloads
33
Keywords
Readme
@shopify/libra-rpc-graphql-server
Libra GraphQL Playground server
Installation
$ yarn add @shopify/libra-rpc-graphql-server
Usage
You can build a new express server by using createSchema
and createContext
from @shopify/libra-rpc-graphql
/* eslint-env node */
/* eslint-disable no-process-env */
import express from 'express';
import {
createContext,
createSchema,
LibraNetwork,
} from '@shopify/libra-rpc-graphql';
import {
applyMiddleware,
createServer,
defaults,
} from '@shopify/libra-rpc-graphql-server';
const port = 8080;
const path = defaults.path;
const app = applyMiddleware(
createServer(createSchema(), {
context: createContext(LibraNetwork.Testnet),
path,
tabs: {minter: true},
}),
);
app.listen(port, () => {
console.log(
`🚀 GraphQL playground running at http://localhost:${port}${path}`,
);
});