artemis.stores.mapgraph.core

clear

added in 0.1.0

(clear store)

Returns a store with entities cleared out.

create-store

added in 0.1.0

(create-store & {:keys [id-fn entities cache-redirects cache-key], :or {id-fn :id, entities {}, cache-redirects {}, cache-key :artemis.stores.mapgraph.core/cache}})

Returns a new MapGraphStore for the given parameters:

  • :id-fn A function that will be passed an entity and should return a unique value that will be used as a reference to that entity. Defaults to :id.
  • :entities A map of stored entities. Defaults to {}.
  • :cache-redirects A map of of field to function, that redirects the root from whence the selection-set will be resolved. Defaults to {}.
  • :cache-key The default generic key for the store’s cache. Defaults to :artemis.stores.mapgrah.core/cache.

MapGraphStore

added in 0.1.0

This store requires that every entity meant to normalize for a GraphQL query resolves a unique value when called against the store’s :id-fn.

store?

added in 0.1.0

(store? store)

Returns true if store is a mapgraph store.