Skip to content
Client
Server

Reference / @open-music-sdk/react / tQuery

Interface: tQuery<T> ​

Defined in: integrations/react/src/query.ts:11

What useQuery takes, for one answer.

Type Parameters ​

T ​

T

Properties ​

queryFn ​

ts
readonly queryFn: () => Promise<T>;

Defined in: integrations/react/src/query.ts:15

Asks as the bound function does, and gives what it hands over. Rejects as the function or request rejects: a TypeError for an argument that is not what it should be, an AppleMusicError for what fails at Apple, the network or a token provider, the reason of a signal among the arguments, or whatever a hook throws.

Returns ​

Promise<T>


queryKey ​

ts
readonly queryKey: readonly unknown[];

Defined in: integrations/react/src/query.ts:13

["open-music-sdk", scope, namespace, function, ...arguments]. An argument that is a schema is the marker "schema", and one that is a function or a signal is undefined in its place. A plain object is keyed by what it holds, the same way, except that a function, a signal or an undefined in it is left out. Anything else is as it is.


retry ​

ts
readonly retry: false;

Defined in: integrations/react/src/query.ts:17

Core retried what should be retried; three more tries on a refusal, or on a mistake, would help nobody.

MIT licensed. Not affiliated with, endorsed by, or sponsored by Apple Inc. Apple Music and MusicKit are trademarks of Apple Inc.