Skip to content

Commit 12ddb7e

Browse files
committed
Improve README.md
Improve mooore Add link to demo Remove dashes Update README.md Update README.md Reorder bullet points
1 parent b38e8e6 commit 12ddb7e

File tree

1 file changed

+110
-13
lines changed

1 file changed

+110
-13
lines changed

README.md

Lines changed: 110 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,38 @@
1-
# graphpack
1+
# [Graphpack](https://codesandbox.io/s/k3qrkl8qlv)
22

3-
A minimalistic zero-config GraphQL server
3+
☄️ A minimalistic zero-config GraphQL server
4+
5+
Check out the [demo](https://codesandbox.io/s/k3qrkl8qlv) on CodeSandbox: https://codesandbox.io/s/k3qrkl8qlv
46

57
## What is included
68

7-
tbd
9+
Graphpack utilizes [`webpack`](https://github.com/webpack/webpack)with [`nodemon`](https://github.com/remy/nodemon) and lets you create GraphQL servers with zero configuration. It uses [`Apollo Server`](https://github.com/apollographql/apollo-server) under the hood, so we get features like [GraphQL Playground](https://github.com/prisma/graphql-playground), [GraphQL Imports](https://github.com/prisma/graphql-import) and many more right out of the box.
10+
11+
- 📦 **Zero-config** out of the box experience
12+
- 🚦 Built-in **Live reload** and automatic recompilation
13+
- 🚨 Super-friendly error messages
14+
- 🎮 GraphQL **Playground** IDE
15+
- ⭐️ **GraphQL imports** in Schema Definition Language
16+
- 🔥 [**Blazing fast**](https://twitter.com/acdlite/status/974390255393505280) bundle times
17+
- ⚡️ **ES module imports** thanks to [Babel](https://github.com/babel/babel)
818

919
## Install
1020

1121
With yarn:
1222

1323
```
14-
yarn add graphpack
24+
yarn add --dev graphpack
1525
```
1626

1727
With npm:
1828

1929
```
20-
npm install graphpack
30+
npm install --save-dev graphpack
2131
```
2232

2333
## Usage
2434

25-
Add following run script to your `package.json`:
26-
27-
```json
28-
"scripts": {
29-
"start": "graphpack"
30-
},
31-
```
35+
### Add entry files: `src/schema.graphql` & `src/resolvers.js`
3236

3337
Add your type definitions under `src/schema.graphql` and add some example types in [SDL](https://graphql.org/learn/schema/#type-language):
3438

@@ -50,4 +54,97 @@ const resolvers = {
5054
export default resolvers;
5155
```
5256

53-
> If you prefer to write the type definitions in JS and parse the queries with [graphql-tag](https://github.com/apollographql/graphql-tag), just save your schema as a JS file under `src/schema.js`. It's also possible to create separate folders `src/schema/index.js` and `src/resolvers/index.js`.
57+
> Graphpack can resolve both `.js` and `.graphql` files. This means you can use any of these folder/file structure:
58+
>
59+
> - `src/resolvers.js`
60+
> - `src/resolvers/index.js`
61+
> - `src/schema.js`
62+
> - `src/schema/index.js`
63+
> - `src/schema.graphql`
64+
> - `src/schema/index.graphql`
65+
66+
### Setup npm run scripts
67+
68+
Add following run scripts to your `package.json`:
69+
70+
```json
71+
"scripts": {
72+
"build": "graphpack build",
73+
"dev": "graphpack"
74+
},
75+
```
76+
77+
### Start dev server:
78+
79+
```sh
80+
yarn dev
81+
```
82+
83+
### Create a production build
84+
85+
```sh
86+
yarn build
87+
```
88+
89+
### Start production build
90+
91+
Simply run the build command and start the app
92+
93+
```sh
94+
yarn build
95+
node ./build/index.js
96+
```
97+
98+
## CLI Commands
99+
100+
### `graphpack` (alias `graphpack dev`)
101+
102+
Runs graphpack in development mode.
103+
104+
### `graphpack build`
105+
106+
Creates a production ready build under the project roots `build` folder.
107+
108+
> Make sure to run `yarn build` before.
109+
110+
## Entry files
111+
112+
tbd
113+
114+
### `src/resolvers.js` (required)
115+
116+
tbd
117+
118+
### `src/schema.js` (required)
119+
120+
tbd
121+
122+
### `src/context.js`
123+
124+
tbd
125+
126+
### `src/config.js`
127+
128+
tbd
129+
130+
## Customize configuration
131+
132+
tbd
133+
134+
### Webpack
135+
136+
tbd
137+
138+
### Apollo Server
139+
140+
tbd
141+
142+
## Acknowledgements
143+
144+
Graphpack was heavily inspired by:
145+
146+
- [backpack](https://github.com/jaredpalmer/backpack)
147+
148+
## License
149+
150+
MIT

0 commit comments

Comments
 (0)