UNPKG

graphql-react

Version:

A GraphQL client for React using modern context and hooks APIs that’s lightweight (< 4 kB) but powerful; the first Relay and Apollo alternative with server side rendering.

20 lines (16 loc) 630 B
import React from "react"; /** * React context for a [`Cache`]{@link Cache} instance. * @kind member * @name CacheContext * @type {object} * @prop {Function} Provider [React context provider component](https://reactjs.org/docs/context.html#contextprovider). * @prop {Function} Consumer [React context consumer component](https://reactjs.org/docs/context.html#contextconsumer). * @example <caption>How to import.</caption> * ```js * import CacheContext from "graphql-react/CacheContext.mjs"; * ``` */ const CacheContext = React.createContext(); CacheContext.displayName = "CacheContext"; export default CacheContext;