DEV Community

Discussion on: You probably don't need useLazyQuery 🙅‍♂️

Collapse
 
akov profile image
Ako

I don't think this is a good idea in this case, you can clearly see that every time user types any letter query fires immediately, it's not good to try to fetch data on any key press.

Collapse
 
bryce profile image
Bryce Dorn

This is a contrived example but the query only fetches when the component is rendered, which in this case is when the input value matches pizza.