Skip to content

Instantly share code, notes, and snippets.

@danielkcz
Created February 14, 2019 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielkcz/34db15c257b253a62c65c16bfd3143a4 to your computer and use it in GitHub Desktop.
Save danielkcz/34db15c257b253a62c65c16bfd3143a4 to your computer and use it in GitHub Desktop.
useQuery
import { useQuery } from 'react-apollo-hooks'
const RandomGiphy = ({ tag }) => {
const { data } = useQuery(
RandomGiphyQuery, {
variables: { tag }
}
}
// handle loading & error states...
return <img src={data.giphy.random.url} />
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment