This hook is used to fetch data from the query connected to Query Store.

Remarks

When you have Query Store provider, this hook connects to it, so you'll get data driven by the store.

See

Example

import {useSourceQuery} from "@use-pico/client";

export const MyQueryComponent = () => {
return <QueryStoreProvider
values={{
filter: {name: "John"},
}}
>
<MyComponent/>
<QueryStoreProvider/>
}

export const MyComponent = () => {
// This will fetch data from query, using filter specified by QueryStoreProvider.
const result = useSourceQuery({
store: QueryStoreProvider,
});
}

Index

Interfaces