Supabase API query not refreshing

Hi,

I've read a bunch of posts related to this, but none have solved my issue.

I have a page with a query on the scaffold that fetches a list of workorders from Supabase via API call and displays them in a column with children.

An "add workorder" button brings the user to a page to create a new workorder (table row). A "save" button on that page has 3 actions:

  • Validate the data entry form

  • Insert the row via direct Supabase backend call (not API)

  • Navigate back to the original list page (I have tried both "back" navigation and 'navigate to")

My problem is the new workorder is not shown on the original list unless I trigger a refresh using a button. I cant seem to get the table to auto refresh when the user lands back on the list page.

Each row has a button the deletes the entry, this works as expected. If the user deletes and entry, the list updates immediately, and also shows any added workorders.

The reason I'm using an API call and not a straight backend call is that my data set is large (multi-tenant) and I want to filter at the backend vs. grabbing the entire data set and filtering at the application. (please correct me if I'm misunderstanding how this works. A Supabase "query rows" action with filter will pull all the data, correct? That could get expensive.)

I have tried having the query on the scaffold (page) and on the column, no difference was seen.

Bonus question: what is the deciding factor on where you locate the query?

Thank you.

1
1 reply