GraphQL Editor LogoTry GraphQL Editor

Obsidian - GraphQL caching client & server module for Deno

October 14, 2020 by Tomek

Deno is a V8-based scripting environment written in Rust & TypeScript aiming to provide a productive, secure scripting environment that a modern programmer needs. Deno aims to overcome all the design flaws and weaknesses of Node. Obsidian is a GraphQL caching client and server module built for Deno.

Obsidian

Obsidian provides a solution to one of the most troublesome aspects of GraphQL - caching. Being optimized for use in server-side rendered React apps built with Deno, enabling its most powerful features, including optimized caching client-server exchanges & super lightweight client-side caching, all that to support the needs of modern applications!

Features:

  • Performance - GraphQL query abstraction and caching in SSR React projects, improving the performance of your app,
  • Normalized caching - caching, optimizing memory management to keep your site lightweight and fast,
  • Flexibility - Fullstack integration, leveraging client-side, and server-side caching to streamline your caching strategy.

How it works

As already mentioned, the problem Obsidian wants to tackle is caching. When your query for data you will get the response from your GraphQL API containing raw data so it could be stored in your application. If you query for a specific property that is stored in the cache, the Obsidian algorithm will find and return it without querying the API once again. Furthermore, Obsidian will store in cache whole queries and responses to shorten lookup time to a minimum. If the algorithm won’t find any matching results in stored data (i.e cache was cleared), Obsidian will fetch them from the server once again.

Getting started

To start using Obsidian we need to install it in both, the server and the client-side:

import { ObsidianRouter } from 'https://deno.land/x/[email protected]/mod.ts';
import { ObsidianWrapper } from 'https://deno.land/x/[email protected]/mod.ts';

The next steps are creating the router, sending `ObsidinaSchema’, creating a wrapper, then you are good to make your first query using Obsidian. To get more in-depth information make sure to visit Obsidian docs.

obsidian deno  query

Source: obsidian.land

Speed up your GraphQL API development

The GraphQL Editor is a supportive tool for both advanced GraphQL users as well as those taking their first steps with GraphQL APIs. Our all-in-one development environment for GraphQL will help you build, manage & deploy your GraphQL API much faster thanks to dozens of built-in micro features. Its graphical interface will also fix communication within your product team. Visualization is the key!

Try it for free

Tomek Poniatowicz
Written by Tomek Poniatowicz GraphQL enthusiast. Magic the Gathering fanatic. Pizza monster. email me:[email protected]Twitter Shield
← Back to blog

Menu

© Copyright 2018 Graphqleditor.com