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:
Post a Comment