Created
March 22, 2018 18:23
-
-
Save peggyrayzis/b9ec1f49e73af68e0a390bdab96ddca8 to your computer and use it in GitHub Desktop.
ApolloConsumer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { ApolloConsumer } from "react-apollo"; | |
import Link from "./Link"; | |
const FilterLink = ({ filter, children }) => ( | |
<ApolloConsumer> | |
{cache => ( | |
<Link | |
onClick={() => cache.writeData({ data: { visibilityFilter: filter } })} | |
> | |
{children} | |
</Link> | |
)} | |
</ApolloConsumer> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment