Documentation / @ember-data/legacy-compat / builders / query
Call Signature
function query<T>(
type,
query,
options?): QueryRequestInput<TypeFromInstance<T>, T[]>;
Defined in: builders/query.ts:38
This function builds a request config for a given type and query object. When passed to store.request
, this config will result in the same behavior as a store.query
request. Additionally, it takes the same options as store.query
.
All @ember-data/legacy-compat
builders exist to enable you to migrate your codebase to using the correct syntax for store.request
while temporarily preserving legacy behaviors. This is useful for quickly upgrading an entire app to a unified syntax while a longer incremental migration is made to shift off of adapters and serializers. To that end, these builders are deprecated and will be removed in a future version of Ember Data.
Type Parameters
T
T
extends TypedRecordInstance
Parameters
type
the name of the resource
query
a query to be used by the adapter
options?
optional, may include adapterOptions
hash which will be passed to adapter.query
Returns
QueryRequestInput
<TypeFromInstance
<T
>, T
[]>
request config
Deprecated
Call Signature
function query(
type,
query,
options?): QueryRequestInput;
Defined in: builders/query.ts:43
This function builds a request config for a given type and query object. When passed to store.request
, this config will result in the same behavior as a store.query
request. Additionally, it takes the same options as store.query
.
All @ember-data/legacy-compat
builders exist to enable you to migrate your codebase to using the correct syntax for store.request
while temporarily preserving legacy behaviors. This is useful for quickly upgrading an entire app to a unified syntax while a longer incremental migration is made to shift off of adapters and serializers. To that end, these builders are deprecated and will be removed in a future version of Ember Data.
Parameters
type
string
the name of the resource
query
a query to be used by the adapter
options?
optional, may include adapterOptions
hash which will be passed to adapter.query
Returns
QueryRequestInput
request config