How to run dynamic Query in Tanstack Query?
0
I've been having a rough time understanding tanstack/query. I'm trying to fetch data using tanstack.
What I'm trying to get is store the data in my state, and then when I press the button, it will pass to my URL and then it will call the button.
This is my sample URL.
http://localhost:5000/api/result?from=8&end=10&year=23&college=CEIS&type=Students
This is my apicall
And this is my getResult
So what i'm trying to do is only get the data once the button is click, is that possible in tanstack/react-query 5?
I've been having a rough time understanding tanstack/query. I'm trying to fetch data using tanstack.
What I'm trying to get is store the data in my state, and then when I press the button, it will pass to my URL and then it will call the button.
This is my sample URL.
http://localhost:5000/api/result?from=8&end=10&year=23&college=CEIS&type=Students
This is my apicall
And this is my getResult
So what i'm trying to do is only get the data once the button is click, is that possible in tanstack/react-query 5?