ArangoDB 3.2: Enhanced GraphQL Sync
Just in time for the upcoming 3.2.0 release, we have updated the graphql-sync module for compatibility with graphql-js versions 0.7.2, 0.8.2, 0.9.6 and 0.10.1. The graphql-sync module allows developers to implement GraphQL backends and schemas in strictly synchronous JavaScript environments like the ArangoDB Foxx framework by providing a thin wrapper around the official GraphQL implementation for JavaScript.
As a long-term database solution, ArangoDB is committed to API stability and avoids upgrades to third-party dependencies that would result in breaking changes. This means ArangoDB will continue to bundle the graphql-js 0.6.2 compatibility version of graphql-sync.
However in order to allow developers to keep up with the rapid development of the GraphQL language and reference implementation, starting with ArangoDB 3.2, services that bring their own version of graphql-sync can now still benefit from the built-in Foxx GraphQL integration.
Simply pass the imported module as the new *graphql* option when creating the router:
const graphql = require('graphql-sync');
const createGraphQLRouter = require('@arangodb/foxx/graphql');
const graphqlSchema = new graphql.Schema({
//...
});
module.context.use(createGraphQLRouter({
schema: graphqlSchema,
graphiql: true,
graphql: graphql
}));
If you want to try out Foxx with the latest release of graphql-sync, grab the ArangoDB 3.2 beta and make sure to include the `node_modules/graphql-sync` folder in your service bundle.
1 Comments
Leave a Comment
Get the latest tutorials, blog posts and news:
看看你的博客,也是一种娱乐!