useEndpointQuery
useEndpointQuery<
Req,Res,Selected>(endpoint,request,options?):UseEndpointQueryResult<Res,Selected,Req>
Defined in: wp-typia-rest/src/react-query.ts:43
Query an endpoint contract and keep the validated result in the shared cache.
Type Parameters
Section titled “Type Parameters”Req
Res
Selected
Section titled “Selected”Selected = Res
Parameters
Section titled “Parameters”endpoint
Section titled “endpoint”ApiEndpoint<Req, Res>
GET endpoint contract to execute.
request
Section titled “request”Req
Query input used to build the cache key and request.
options?
Section titled “options?”UseEndpointQueryOptions<Req, Res, Selected> = {}
Cache, fetch, and lifecycle options for the query.
Returns
Section titled “Returns”UseEndpointQueryResult<Res, Selected, Req>
Query state, cached data, validation details, and a refetch helper.
Remarks
Section titled “Remarks”Use select, enabled, and staleTime to adapt the hook to UI needs
without leaking transport or validation details into components.
Example
Section titled “Example”const query = useEndpointQuery(endpoint, { slug: "hero-card" });