We can use useQuery to fetch data from the network and cache it. In this article, we will see how useQuery can ease our job in polling and refetching APIs conditionally with a small example. We, The query data for an infinite query all lives under a single query key. type InboxQueryKey = ["inbox"]; const inboxQueryKey: InboxQueryKey = ["inbox"]; function useInboxQuery() { return, Whether you need to poll an API at a regular interval, fetch data in the background, or transform the data before it’s returned to the component, options like refetchInterval, refetchIntervalInBackground, and select make it easy to get the job done., Placeholder data allows a query to behave as if it already has data, similar to the initialData option, but the data is not persisted to the cache. This comes in handy for situations where you have enough partial (or fake) data to render the query successfully while the actual data is fetched in the background., If set, this value will be used as the placeholder data for this particular query observer while the query is still in the loading data and no initialData has been provided., Surround your input by % instead of putting it into the query: WHERE municipio like ?") $stmt->bind_param ('s', '%' . $incity . '%'); The syntax of putting in named placeholders is supported by the PDO library, not MySQLi. With MySQLi, the first param indicates the type of variable (e.g. i = integer, s = string, etc)..