
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
graphql-hooks-memcache
Advanced tools
In-memory caching implementation for graphql-hooks
npm install graphql-hooks-memcache
or
yarn add graphql-hooks-memcache
This is intended to be used as the cache
option when calling createClient
from graphql-hooks
.
import { GraphQLClient } from 'graphql-hooks'
import memCache from 'graphql-hooks-memcache'
const client = new GraphQLClient({
url: '/graphql',
cache: memCache()
})
memCache(options)
: Option object properties
size
: The number of items to store in the cachettl
: Milliseconds an item will remain in cache. The default behaviour will only evict items when the size
limit has been reachedinitialState
: The value from cache.getInitialState()
used for rehydrating the cache after SSRcache.get(key)
: Find the item in the cache that matches key
cache.set(key, value)
: Set an item in the cachecache.delete(key)
: Delete an item from the cachecache.clear()
: Clear all items from the cachecache.keys()
: Returns an array of keys, useful when you need to iterate over the cache itemscache.getInitialState()
: A serialisable version of the cache - used during SSRFAQs
In memory cache for graphql-hooks
The npm package graphql-hooks-memcache receives a total of 2,471 weekly downloads. As such, graphql-hooks-memcache popularity was classified as popular.
We found that graphql-hooks-memcache demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.