Skip to content
module@warp-drive/legacy/compat/builders @legacy

Function query() ​

ts
function query<T extends TypedRecordInstance>(
   type: TypeFromInstance<T>, 
   query: LegacyResourceQuery, 
   options?: QueryOptions
): QueryRequestInput<TypeFromInstance<T>, T[]>;
function query(
   type: string, 
   query: LegacyResourceQuery, 
   options?: QueryOptions
): QueryRequestInput;

Call Signature deprecated ​

ts
function query<T extends TypedRecordInstance>(
   type: TypeFromInstance<T>, 
   query: LegacyResourceQuery, 
   options?: QueryOptions
): QueryRequestInput<TypeFromInstance<T>, T[]>;

Defined in: warp-drive-packages/legacy/src/compat/builders/query.ts:40

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 @warp-drive/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 WarpDrive.

Type Parameters ​

T ​

T extends TypedRecordInstance

Parameters ​

type ​

TypeFromInstance<T>

the name of the resource

query ​

LegacyResourceQuery

a query to be used by the adapter

options? ​

QueryOptions

optional, may include adapterOptions hash which will be passed to adapter.query

Returns ​

QueryRequestInput<TypeFromInstance<T>, T[]>

request config

Deprecated ​

Call Signature deprecated ​

ts
function query(
   type: string, 
   query: LegacyResourceQuery, 
   options?: QueryOptions
): QueryRequestInput;

Defined in: warp-drive-packages/legacy/src/compat/builders/query.ts:45

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 @warp-drive/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 WarpDrive.

Parameters ​

type ​

string

the name of the resource

query ​

LegacyResourceQuery

a query to be used by the adapter

options? ​

QueryOptions

optional, may include adapterOptions hash which will be passed to adapter.query

Returns ​

QueryRequestInput

request config

Deprecated ​

Released under the MIT License.