Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mccallofthewild/apollo-cant-cache-me

Disables the Apollo Client cache
https://github.com/mccallofthewild/apollo-cant-cache-me

Last synced: 4 days ago
JSON representation

Disables the Apollo Client cache

Awesome Lists containing this project

README

        

# Apollo Can't Cache Me
> A library for disabling Apollo Client Cache.

## Usage

```javascript
import { ApolloClient } from 'apollo-client'
import { disableCache } from 'apollo-cant-cache-me'

const GRAPHQL_URI = 'http://localhost:8080/graphql'

export const client = disableCache(
new ApolloClient({
link: new HttpLink({
uri: GRAPHQL_URI
}),
cache: new InMemoryCache({
dataIdFromObject: object => object.__id
})
})
);
```