@shopify/libra-rpc-graphql-server

Libra GraphQL Playground Apollo server running on express

Usage no npm install needed!

<script type="module">
  import shopifyLibraRpcGraphqlServer from 'https://cdn.skypack.dev/@shopify/libra-rpc-graphql-server';
</script>

README

@shopify/libra-rpc-graphql-server

Build Status License: MIT npm version

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}`,
  );
});