How to run queries from a View
query
attribute. This attribute must be a string, which represents the path to the query that will be run. This path is relative to the queries
folder in your project.
inlineParams
attribute. This attribute must be an object, where each key is the name of the parameter, and the value is the value that will be used for that parameter.
inlineParams
will override the global value.
This also allows you to run the same query multiple times with different parameters within the same View.
You can also override a parameter using the value from another parameter, using the input
function.
reactToParams
option in the opts
attribute of the component.
This option can be set with a number, that represents the number of milliseconds that the query will wait before re-running after a parameter change.
This debouonce is useful to avoid running the query multiple times when the user is still typing the parameter value, as runnning the query on every key press could be too expensive.
However, if you want the query to run immediately after a parameter change, you can set this option to 0
.
reactiveToParams
has been deprecated. Please replace it with reactToParams