Documentation / queries/QueryFor
queries/QueryFor
Classes
abstract
QueryFor<TDataType, TArguments>
Represents an implementation of IQueryFor.
Type Parameters
• TDataType
Type of data returned by the query.
• TArguments = object
Implements
IQueryFor
<TDataType
,TArguments
>
Constructors
new QueryFor()
new QueryFor<
TDataType
,TArguments
>(modelType
,enumerable
):QueryFor
<TDataType
,TArguments
>
Initializes a new instance of the ObservableQueryFor<,>} class.
Parameters
modelType
Constructor
Type of model, if an enumerable, this is the instance type.
enumerable
boolean
Whether or not it is an enumerable.
Returns
QueryFor
<TDataType
, TArguments
>
Defined in
Properties
abortController?
optional
abortController:AbortController
Defined in
arguments
arguments:
undefined
|TArguments
Gets the current arguments for the query.
Implementation of
Defined in
defaultValue
abstract
defaultValue:TDataType
Implementation of
Defined in
enumerable
readonly
enumerable:boolean
Whether or not it is an enumerable.
Defined in
modelType
readonly
modelType:Constructor
Type of model, if an enumerable, this is the instance type.
Defined in
paging
paging:
Paging
Gets the paging for the query.
Implementation of
Defined in
route
abstract
readonly
route:string
Implementation of
Defined in
routeTemplate
abstract
readonly
routeTemplate:TemplateDelegate
Implementation of
Defined in
sorting
sorting:
Sorting
Gets the sorting for the query.
Implementation of
Defined in
Accessors
requiredRequestArguments
Get Signature
get
abstract
requiredRequestArguments():string
[]
Returns
string
[]
Implementation of
IQueryFor
.requiredRequestArguments
Defined in
Methods
perform()
perform(
args
?):Promise
<QueryResult
<TDataType
>>
Perform the query, optionally giving arguments to use. If not given, it will use the arguments that has been set. By specifying the arguments, it will use these as the current arguments for the instance and subsequent calls does not need to specify arguments.
Parameters
args?
TArguments
Optional arguments for the query - depends on whether or not the query needs arguments.
Returns
Promise
<QueryResult
<TDataType
>>
for the model
Implementation of
Defined in
setApiBasePath()
setApiBasePath(
apiBasePath
):void
Set the base path for the API to use for the query. This is used to prepend to the path to any fetch operation.
Parameters
apiBasePath
string
Base path for the API
Returns
void
Implementation of
Defined in
setMicroservice()
setMicroservice(
microservice
):void
Set the microservice to be used for the query. This is passed along to the server to identify the microservice.
Parameters
microservice
string
Name of microservice
Returns
void