home shape

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.

Alan Plum avatar 1418721602 92x92

Alan Plum

Alan is an experienced web developer who feels equally at home in the backend and frontend. At ArangoDB he works on everything regarding JavaScript, with a special focus on Foxx.

1 Comment

  1. 增达网 on June 25, 2017 at 11:49 am

    看看你的博客,也是一种娱乐!

Leave a Comment





Get the latest tutorials, blog posts and news: