How to enable a query for a specific query param
I have a GET endpoint, in which the values for the query params are passed in as arguments to the query, e.g.
I only need to filter on the first query param, which is
Another API call would be required if the
An example would be, a user searches for console. The
I thought of using the
What would be a good way to go about this?
I only need to filter on the first query param, which is
item , which will display an array of items which can be narrowed down further with the id query param.Another API call would be required if the
id query param has a value, which will then return an array of items, which can no longer be narrowed down.An example would be, a user searches for console. The
item query param will be console and in the response, you may find an object with a description property of "Nintendo - Switch, Wii U, Wii", and also has an id property. If the user selects this option, then the value id is passed into the id query param and a new list of items gets rendered. This time with the individual item.I thought of using the
refetch function, but it doesn't permit arguments being passed in.What would be a good way to go about this?