Demo
⚠️ Warning: No servers are used, or harmed, in the resolving of these GraphQL queries
To quickly show a few of the features in action here we have:
- Setting up a GraphQL query handler and making a query
- Using
graphql-paperpackage, an in-memory graphql store, which allows stateful queries (try a mutation and see the change persist in subsequent queries) - An embedded
logWrapperhighlighted on all root-level Query resolvers for logging. Check the developer console for helpful logging after each query run.
Go ahead and do a few queries and mutations (see changes persist)
GraphiQL
Query Variables
Request Headers
The Code
// 1. Setup your handler
const handler = new GraphQLHandler({
// optionally, provide a base resolver map
resolverMap,
// use middlewares from packages, make your own,
// and embed resolver wrappers
middlewares: [
embed({
// Highlight makes it easy to declaratively select
// what resolvers should be wrapped with the `logWrapper`
highlight: (h) => h.include(field(['Query', '*']))
wrappers: [logWrapper],
}),
]
// add dependencies needed by middlewares or resolvers
dependencies: {
graphqlSchema,
paper: new Paper(graphqlSchema)
},
});
// 2. Run queries (or mutations)!
handler.query(`
query {
...
}
`);


