useQuery
How to run queries from your React app
Introduction
Although there are some components that can run queries automatically, you can also run them manually from your React app, and do whatever you want with the results.
Running queries
To run a query from your React app, you can use the provided useQuery
function.
This function has the following options:
Properties
The path of the query you want to run.
The variables you want to pass to the query.
See the Queries section to learn more about the query configuration.
Returned attributes
The data returned by the query. Will be null
if the query is still running or if there was an error.
Check QueryResult to learn more about the data structure.
A boolean that indicates if the query is still running.
The error returned by the query. Will be null
if there was no error.
A function that allows you to run the query again.