As I’ve integrated GraphQL with in my previous post ( ), what I wanted to do next was to integrate it with the database. So I wanted to persist data to storage. The database could have been anything but I chose this time. This is how the architecture looks like. You can find the code for this project in . OpenFaaS “Integrating OpenFaaS and GraphQL” ArangoDB kenfdev/openfaas-graphql-blog And the video below shows what I’ve achieved with this architecture. (some parts are fast forwarded) I wanted everyone to easily be able to create this environment so I’ve chose Docker Swarm for the orchestration tool. Just hit a few commands and you can use the graphql blog. Of course you can choose your own orchestration tool which is listed but this is off the topic of this post. here The GraphQL Blog This service is inspired by the but it isn’t tied to AWS. In addition, it lacked some relations (afaik) between entities so I added some of them. So this graphql blog can: serverless/serverless-graphql-blog create an author create a post for an author create a comment for a post query authors query posts and its comments I haven’t bundled a frontend for this GraphQL Blog so you’ll need a client like to query the server (you can find one ). GraphiQL here Try It! You can follow along from here if you want to try this project. I’m assuming you have knowledge about Docker and you have it installed. After you clone , prepare your swarm by hitting the project docker swarm init and deploy the stack by executing . After the deploy succeeds, it will take a few seconds for the arangodb to be prepared to receive requests. Poll until you see the login form of arangodb. deploy_stack.sh http://localhost:8529 Then, you’ll need to prepare the database and collections. You can find in the project. Execute this and you’re ready to use the GraphQL Blog. By the way, you can check the function from the gateway UI of OpenFaaS. arango/setup_database.sh GraphQL Blog Function via OpenFaaS Create an Author You can create an author by using the mutation. createAuthor mutation {createAuthor(name: "Jane") {idname}} and the response would be something like this (remember the because you’ll use it later): id {"data": {"createAuthor": {"id": "4350","name": "Jane"}}} Create a Post You can create a post by using the mutation. createPost mutation {createPost(title: "Some Sample Post", bodyContent: "This is a sample post", author: "4350") {idtitlebodyContentauthor {name}comments {id}}} and the response would be something like this (remember this as well): id {"data": {"createPost": {"id": "4849","title": "Some Sample Post","bodyContent": "This is a sample post","author": {"name": "Jane"},"comments": []}}} Add a Comment to a Post You can add a comment to a post via mutation. You’ll need an author and a post for this. createComment id id mutation {createComment(content: "This is a comment", author: "4350", post: "4849") {idcontentauthor {name}}} and the response would be this: {"data": {"createComment": {"id": "5018","content": "This is a comment","author": {"name": "Jane"}}}} Query the Post Now that we have a post and a comment for the post, let’s query it via the query. posts query {posts(authorId: "4350") {idtitlebodyContentauthor {name}comments {contentauthor {name}}}} And the response would be: {"data": {"posts": [{"id": "4849","title": "Some Sample Post","bodyContent": "This is a sample post","author": {"name": "Jane"},"comments": [{"content": "This is a comment","author": {"name": "Jane"}}]}]}} Cool isn’t it? A serverless GraphQL Blog launched in nearly 60 seconds! What’s Next… We now have a working serverless GraphQL Blog. But we haven’t looked into the benefits of OpenFaaS much. In the next post I’ll look into how this function scales when there are request spikes. If you’re interested in OpenFaaS, please show support by giving a Star to the GitHub repo !