I'm curious how use-supabase does this. ```// crea...
# help
b
I'm curious how use-supabase does this.
Copy code
// create a query and use all the postgres query options
const query = useSupabase().from('site').select('*')
// pass that query to useQuery and get automatic SWR revalidation on it.
const { data: queryData } = useQuery(query)
useSupabase() returns the supabase client. They use this to construct queries, but doesn't it make an API call as well?
n
Hello @benten! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ``...`` menu) and select "Leave Thread" to unsubscribe from future updates. Want to change the title? Use the ``/title`` command! We have solved your problem? Click the button below to archive it.
g
n
benten (2022-05-21)
b
Yeah I'm just curious why calling it synchronously returns a query, but calling it async actually fetches the data. I guess it's more of an JS question