Data Queries
The Query type is used to define declarative data requests. It is required input for the useDataQuery hook and DataQuery component.
Query
A query is a map of names to QueryDefinition objects. The name can be any string. Multiple QueryDefinition components of a single Query will be fetched in parallel if possible.
i.e.
const query = {
myData: {
resource: 'indicators',
},
}
QueryDefinition
Property | Type | Description | |
---|---|---|---|
resource | string | required | The path to the resource being requested, i.e. indicators . |
id | string or () => string | Optional, when specified indicates that a particular instance of a collection will be requested | |
params | Object or () => Object | A dictionary of properties which are translated into querystring parameters when the data is fetched |
See the Query type definition for more information