Hey, ricky. Please try and ask help questions in the help thread in the future.
RPC calls can return data just like select, even including a setof rows. So you would use it just like you would a select call in react-query.
If you need specific help with rpc and returning the correct data from a Postgres function, you should probably ask that as a new question with more detail on what you are trying to do.
If you have questions on using react-query with Supabase in general, there are many hits I see on google. Including this one:
https://dev.to/sruhleder/using-react-query-with-supabase-a03