All Projects → convoyinc → Apollo Cache Hermes

convoyinc / Apollo Cache Hermes

Licence: other
A cache implementation for Apollo Client, tuned for performance

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Apollo Cache Hermes

Artemis Dev Tool
An Apollo GraphQL Query Schema Testing Tool
Stars: ✭ 66 (-84.47%)
Mutual labels:  graphql, apollo, apollo-client
React Graphql Github Apollo
🚀 A React + Apollo + GraphQL GitHub Client. Your opportunity to learn about these technologies in a real world application.
Stars: ✭ 1,563 (+267.76%)
Mutual labels:  graphql, apollo, apollo-client
Apollo Upload Client
A terminating Apollo Link for Apollo Client that allows FileList, File, Blob or ReactNativeFile instances within query or mutation variables and sends GraphQL multipart requests.
Stars: ✭ 1,176 (+176.71%)
Mutual labels:  graphql, apollo, apollo-client
Blaze Apollo
Blaze integration for the Apollo Client
Stars: ✭ 56 (-86.82%)
Mutual labels:  graphql, apollo, apollo-client
Reactql
Universal React+GraphQL starter kit: React 16, Apollo 2, MobX, Emotion, Webpack 4, GraphQL Code Generator, React Router 4, PostCSS, SSR
Stars: ✭ 1,833 (+331.29%)
Mutual labels:  graphql, apollo, apollo-client
Guide To Graphql
A Frontend Developer's Guide to GraphQL (Fluent Conf 2018)
Stars: ✭ 59 (-86.12%)
Mutual labels:  graphql, apollo, apollo-client
Apollo Link
🔗 Interface for fetching and modifying control flow of GraphQL requests
Stars: ✭ 1,434 (+237.41%)
Mutual labels:  graphql, apollo, apollo-client
React Boilerplate
⚛ The stable base upon which we build our React projects at Mirego.
Stars: ✭ 39 (-90.82%)
Mutual labels:  graphql, apollo, apollo-client
Graphql Directive
Use custom directives in your GraphQL schema and queries 🎩
Stars: ✭ 142 (-66.59%)
Mutual labels:  graphql, apollo, apollo-client
React Redux Graphql Apollo Bootstrap Webpack Starter
react js + redux + graphQL + Apollo + react router + hot reload + devTools + bootstrap + webpack starter
Stars: ✭ 127 (-70.12%)
Mutual labels:  graphql, apollo, apollo-client
A Pop
🎶 HD Music Streaming and Sharing Web App
Stars: ✭ 55 (-87.06%)
Mutual labels:  graphql, apollo, apollo-client
Apollo Cache Redux
Redux cache for Apollo Client 2.0. This project is no longer maintained.
Stars: ✭ 179 (-57.88%)
Mutual labels:  graphql, apollo, apollo-client
Apollo Invalidation Policies
An extension of the Apollo 3 cache with support for type-based invalidation policies.
Stars: ✭ 55 (-87.06%)
Mutual labels:  graphql, apollo, apollo-client
Cynthesize Frontend
Frontend written in Angular 7 and deployed GraphQL for Cynthesize. Development build: https://cynthesize-develop.netlify.com
Stars: ✭ 65 (-84.71%)
Mutual labels:  graphql, apollo, apollo-client
Crypto Grommet
Crypto and equities app
Stars: ✭ 39 (-90.82%)
Mutual labels:  graphql, apollo, apollo-client
Guide
📖 The GraphQL Guide website
Stars: ✭ 104 (-75.53%)
Mutual labels:  graphql, apollo, apollo-client
Chatty
A WhatsApp clone with React Native and Apollo (Tutorial)
Stars: ✭ 481 (+13.18%)
Mutual labels:  graphql, apollo, apollo-client
Link state demo
🚀 Demonstrate how to support multiple stores in Apollo Link State
Stars: ✭ 30 (-92.94%)
Mutual labels:  graphql, apollo, apollo-client
Awesome Apollo Graphql
A curated list of amazingly awesome things regarding Apollo GraphQL ecosystem 🌟
Stars: ✭ 126 (-70.35%)
Mutual labels:  graphql, apollo, apollo-client
Next Graphql Blog
🖊 A Blog including a server and a client. Server is built with Node, Express & a customized GraphQL-yoga server. Client is built with React, Next js & Apollo client.
Stars: ✭ 152 (-64.24%)
Mutual labels:  graphql, apollo, apollo-client

Hermes: A Cache For Apollo Client

npm Build Status Code Coverage

An alternative cache implementation for Apollo Client, tuned for the performance of heavy GraphQL payloads.

This is very much a work in progress! It currently meets most of our needs internally, but is not yet a drop-in replacement for Apollo's default in memory cache. See the roadmap to get a sense of the work that's left.

What Makes It Different?

This cache maintains an immutable & normalized graph of the values received from your GraphQL server. It enables the cache to return direct references to the cache, in order to satisfy queries1. As a result, reads from the cache require minimal work (and can be optimized to constant time lookups in some cases). The tradeoff is that rather than receiving only the fields selected by a GraphQL query, there may be additional fields.

This is in contrast to the built in cache for Apollo (and Relay), which maintain a normalized map of values. The unfortunate reality of those caches is that read operations impose considerable overhead (in CPU and memory) in order to build a result payload. See the motivation behind this cache, as well as the design exploration for a deeper discussion.

1 If your query contains parameterized fields, there is some work that the cache has to perform during read, in order to layer those fields on top of the static values within the cache.

What Doesn't It Do?

Hermes is still early days! Some things it doesn't (yet!) support:

Union types: Hermes currently ignores union types and type constraints on fragments. It can just work, but you will likely run into trouble if you are expecting the cache to be able to differentiate stored state based on the node type.

writeData: Hermes doesn't yet implement writeData.

None of these are things that Hermes can't support; we just haven't had time to build those out yet. If you're interested in contributing, please feel free to hit us up; we'd love to work together to get them figured out!

Using The Cache

Not too different from Apollo's in memory cache, but configuration is slightly different.

import { ApolloClient } from 'apollo-client';
import { Hermes } from 'apollo-cache-hermes';

const client = new ApolloClient({
  cache: new Hermes({  }),
  // …
});

By default, the cache will consider all nodes with an id field to be entities (e.g. normalized nodes in the graph).

For now, please refer to the source when looking up configuration values - they're likely to change, and new options to be added.

Contributing

Interested in helping out? Awesome! If you've got an idea or issue, please feel free to file it, and provide as much context as you can.

Local Development

If you're looking to contribute some code, it's pretty snappy to start development on this repository:

git clone https://github.com/convoyinc/apollo-cache-hermes
cd apollo-cache-hermes
yarn

# Leave this running while you're working on code — you'll receive immediate
# feedback on compile and test results for the files you're touching.
yarn dev
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].