This repo demonstrates how a GraphQL middleware server can be used to run queries against Crate DB.
This project uses buildout to manage its dependencies. The only thing you
need is a working python >= 2.7
installed.
python bootstrap.py
bin/buildout -N
bin/npm install
If you haven't used buildout
and installed npm
globally you can simply run:
npm install
npm is going to install you the required dependencies for running the GraphQL middleware server. These packages are listed below:
- graphql, the reference implementation of GraphQL in JS
- express, a minimalist web framework
- express-graphql, the HTTP server for exposing GraphQL
- crate-js, a node.js driver for Crate
- q, the promise library for node
If your environment setup is successful the middleware can be started:
bin/node index.js
This will start the GraphQL server and the HTTP endpoint is set to http://localhost:3000/graphql. If you open this URL in a browser you are able to run GraphQL-queries with the interactive in-browser Graphiql IDE.