gestalt-server
v0.0.20
Published
schema defined graphql server
Downloads
17
Readme
gestalt-server
Connect middleware based on express-graphql
to create a GraphQL API server
using the Gestalt framework. Accepts the following options:
schemaPath
- the path to your schema definition in GraphQLdatabase
- a database adapterobjects
- an array of object definitionsmutations
- an array of mutation definition functionssecret
- used to sign the session cookiedevelopment
- a boolean, if true gestalt will log queries and serve the GraphiQL IDE.
import gestaltServer from 'gestalt-server';
import gestaltPostgres from 'gestalt-postgres';
import importAll from 'import-all';
const app = express();
app.use('/graphql', gestaltServer({
schemaPath: `${__dirname}/schema.graphql`,
database: gestaltPostgres({
databaseURL: 'postgres://localhost'
}),
objects: importAll(`${__dirname}/objects`),
mutations: importAll(`${__dirname}/mutations`),
secret: '༼ つ ◕_◕ ༽つ',
}));
app.listen(3000);