You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.
When making an arbitrary query with connectWpQuery, resources end up getting stored on props.kasia.data, even if only one resource was fetched.
It'd be nice if there was a concise way to translate an arbitrary query to a single resource and have that resource get passed as a prop, instead of having to filter through data to find the originally requested resource.
Right now, I'm thinking about overloading KasiaConnectWpQueryComponent::_makePropsData to be closer to the same method of KasiaConnectWpPostComponent. Is that something of enough utility that it should be considered for this library?
The text was updated successfully, but these errors were encountered:
Hey Josh- that sounds useful. It's definitely a pain point having to trudge through the props for a single entity when using connectWpQuery.
The approach seems good. Did you have something in mind API wise? In 4.2 we have the options object available to us when using connectWpQuery - we could do something like single=true.
Or were you thinking that recognising a request which returned a single entity would be performed automatically? My only worry with this is that it could be confusing for someone who hasn't thoroughly read the documentation (the result not being on props.data).
When making an arbitrary query with
connectWpQuery
, resources end up getting stored onprops.kasia.data
, even if only one resource was fetched.It'd be nice if there was a concise way to translate an arbitrary query to a single resource and have that resource get passed as a prop, instead of having to filter through data to find the originally requested resource.
Right now, I'm thinking about overloading
KasiaConnectWpQueryComponent::_makePropsData
to be closer to the same method ofKasiaConnectWpPostComponent
. Is that something of enough utility that it should be considered for this library?The text was updated successfully, but these errors were encountered: