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
- Host: GitHub
- URL: https://github.com/benjaminboruff/mini-graphql
- Owner: benjaminboruff
- Created: 2018-03-26T00:10:41.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-05T15:49:57.000Z (about 8 years ago)
- Last Synced: 2025-01-20T16:42:01.457Z (over 1 year ago)
- Topics: graphql, micro, template
- Language: JavaScript
- Homepage:
- Size: 104 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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