Introduction

The RunButton component lets users manually refetch the contents of a query, or a group of queries, by clicking a button.

See Refetching a query for more information on how queries are fetched.

Usage

To use the RunButton component, simply add it to any view like this:

<RunButton>Run</RunButton>

When you click the button, it will run all queries being used in the view.

You can also specify a query to run:

<RunButton query="users">Run</RunButton>

This will run the users query when the button is clicked, and it will reactively update the view with the results.

Finally, you can specify an array of queries to run:

<RunButton queries={["users", "transactions"]}>Run</RunButton>

This will run the users and transactions queries when the button is clicked, and it will update the view accordingly.