Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Updated GraphQL Sync in ArangoDB 3.2

DZone's Guide to

Updated GraphQL Sync in ArangoDB 3.2

A new GraphQL module is being included with the ArangoDB 3.2 release! Come check out what it can do and how you can get up and running with it!

· Database Zone ·
Free Resource

Read the 2019 State of Database DevOps Report for the very latest insights

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:

```js
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.

Read the 2019 State of Database DevOps Report for latest insights into DevOps adoption among SQL Server professionals, and the benefits and challenges of including the database in DevOps initiatives

Topics:
database ,graphql ,arangodb

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}