Redundant call to items in SelectArrayInput
See original GitHub issueIs your feature request related to a problem? Please describe.
When I have basic usage of SelectArrayInput
with ReferenceArrayInput
and I know referenced data items will be always less than page size because they’re static, I would like to avoid Get many call to selected items inside useReferenceArrayInputController
as it doesn’t make sense to fetch the data again, I have all data I need and I (as a developer) assure that.
<ReferenceArrayInput source="allowedRegions" reference="region">
<SelectArrayInput placeholder="Choose" />
</ReferenceArrayInput>
my point is that there is no filter
query parameter for these simple static (enum like) endpoints at our API.
Describe the solution you’d like
Allow manual suspend of request to getMany items in useReferenceArrayInputController
something like
<ReferenceArrayInput source="allowedRegions" reference="region" suspendGetManyFetch>
<SelectArrayInput placeholder="Choose" />
</ReferenceArrayInput>
Describe alternatives you’ve considered Don’t have an idea how to solve this better 🤷♂️
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:6 (1 by maintainers)
I meant it to be a static property, not changing over time. Once you know your api returns less than 10 items all the time, as the result is static list, you can use it and don’t worry about missing data. As I said, it would delegate responsibility to the developer…
The property you suggest seems reasonable, but I don’t have such deep knowledge of internals. Is the data cache shared between
getList
andgetMany
calls? So that if there are already two items in data cache returned bygetList
then call to
getMany(2)
will return the item from the cache?