Friday, October 06, 2017

Autogenerate GraphQL for ArangoDB

DZone Database Zone
Autogenerate GraphQL for ArangoDB
Autogenerate GraphQL for ArangoDB

Currently, querying ArangoDB with GraphQL requires building a GraphQL.js schema. This is tedious, and the resulting JavaScript schema file can be long and bulky. Here, we will demonstrate a short proof of concept that reduces the user-related part to only defining the GraphQL IDL file and simple AQL queries.

The Apollo GraphQL project built a library that takes a GraphQL IDL and resolver functions to build a GraphQL.js schema. Resolve functions are called by GraphQL to get the actual data from the database. I modified the library in a way that before the resolvers are added, I read the IDL AST and create resolver functions.

No comments:

Fun With SQL: Functions in Postgres

DZone Database Zone Fun With SQL: Functions in Postgres In our previous  Fun with SQL  post on the  Citus Data  blog, we covered w...