Apollo GraphQL React - how to query on click?

Answer • 1 Asked • Jun 24 2019
In the Apollo React docs http://dev.apollodata.com/react/queries.html#basics there are examples of fetching automatically when the component is shown, but I'd like to run a query when a button is clicked.

I see an example to "re"fetch a query when a button is clicked, but I don't want it to query initially. I see there is a way to call mutations, but how do you call queries?

Write your answer...

On a mission to build Next-Gen Community Platform for Developers