You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Check out the [demo](https://codesandbox.io/s/k3qrkl8qlv) on CodeSandbox: https://codesandbox.io/s/k3qrkl8qlv
4
6
5
7
## What is included
6
8
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)
Add your type definitions under `src/schema.graphql` and add some example types in [SDL](https://graphql.org/learn/schema/#type-language):
34
38
@@ -50,4 +54,97 @@ const resolvers = {
50
54
exportdefaultresolvers;
51
55
```
52
56
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.
0 commit comments