☄️ A minimalistic zero-config GraphQL server
Check out the demo on CodeSandbox: https://codesandbox.io/s/k3qrkl8qlv
Graphpack utilizes webpackwith nodemon and lets you create GraphQL servers with zero configuration. It uses Apollo Server under the hood, so we get features like GraphQL Playground, GraphQL Imports and many more right out of the box.
- 📦 Zero-config out of the box experience
- 🚦 Built-in Live reload and automatic recompilation
- 🚨 Super-friendly error messages
- 🎮 GraphQL Playground IDE
- ⭐️ GraphQL imports in Schema Definition Language
- 🔥 Blazing fast bundle times
- ⚡️ ES module imports thanks to Babel
With yarn:
yarn add --dev graphpack
With npm:
npm install --save-dev graphpack
Add your type definitions under src/schema.graphql and add some example types in SDL:
type Query {
hello: String
}Add your resolvers under src/resolvers.js:
const resolvers = {
Query: {
hello: () => 'world!',
},
};
export default resolvers;Graphpack can resolve both
.jsand.graphqlfiles. This means you can use any of these folder/file structure:
src/resolvers.jssrc/resolvers/index.jssrc/schema.jssrc/schema/index.jssrc/schema.graphqlsrc/schema/index.graphql
Add following run scripts to your package.json:
"scripts": {
"build": "graphpack build",
"dev": "graphpack"
},yarn devyarn buildSimply run the build command and start the app
yarn build
node ./build/index.jsRuns graphpack in development mode.
Creates a production ready build under the project roots build folder.
Make sure to run
yarn buildbefore.
tbd
tbd
tbd
tbd
tbd
tbd
tbd
tbd
Graphpack was heavily inspired by:
MIT