An open API service indexing awesome lists of open source software.

https://github.com/benjaminboruff/mini-graphql

GraphQL template using Zeit's micro (and micro-dev), microrouter, and Apollo's apollo-server-micro
https://github.com/benjaminboruff/mini-graphql

graphql micro template

Last synced: 2 months ago
JSON representation

GraphQL template using Zeit's micro (and micro-dev), microrouter, and Apollo's apollo-server-micro

Awesome Lists containing this project

README

          

# A small GraphQL server
#### using [micro](https://github.com/zeit/micro), [microrouter](https://www.npmjs.com/package/microrouter), and [apollo-server-micro](https://www.npmjs.com/package/apollo-server-micro)

##### Install

> git clone https://github.com/benjaminboruff/mini-graphql.git

> cd mini-graphql && yarn

##### Usage

* Development - watches and builds ES* in one terminal, and runs `micro-dev` in another.

In one terminal:
>yarn dev:babel

In another terminal:
>yarn dev:micro

* Build and start server - compiles using babel, and starts the *production* `micro` server.
>yarn start

* Make a production build in `dist/`
>yarn build

* A simple client data request using `curl`
> curl -XPOST -H "Content-Type:application/json" -d '{"query": "{books { title author { firstName lastName }}}"}' http://localhost:3000/graphql