1.3.1 • Published 3 years ago

@saltyaom/gql-inmemory-cache v1.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@saltyaom/in-memory-cache

In-Memory Cache for @saltyaom/gql

Example Usage

import gql, { client } from '@saltyaom/gql'
import InMemoryCache from '@saltyaom/gql-inmemory-cache'

client.config(
  'https://api.hifumin.app', 
  {
    plugins: [InMemoryCache()]
  }
)

gql(
  `query GetHentaiById($id: Int!) {
    getHentaiById(id: $id) {
      success
      data {
        title {
          display
          japanese
        }
      }
    }
  }`,
  {
    variables: {
      id: 177013
    }
  }
).then((data) => {
  console.log(data)
})

Custom Config

You can pass custom config to localCache()

Available config:

  • ttl
    • How long should the cache live in seconds.
    • default: 86400 seconds (1 days)
1.3.1

3 years ago

1.3.0

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago