Why is useSelect ignores fetchSize? #2691
-
Deps:
Example: const { selectProps: someDataSelectProps } = useSelect<SomeData>({
resource: 'someResource',
fetchSize: 5,
optionValue: 'id',
optionLabel: 'displayName',
queryOptions: {
enabled: true,
staleTime: Timer.FifteenMinutes
}
}) This will get you the correct data back, but in the network tab you will see 2 queries being made one ex: Req One: SomeData
Req Two: SomeData/page=0&pageSize=5 I'm a bit confused about why is there a fetchSize option if it fetches all data on initial render that exists anyway? Clarification: If you use useList, with overridden pagination, it will work and make expected 1 query only const res = useList<SomeData>({
resource: 'someResource',
config: {
pagination: {
current: 1,
pageSize: 100
},
filters: [
{
field: 'sort',
operator: 'eq',
value: 'NameAsc'
}
]
},
queryOptions: {
enabled: true,
staleTime: Timer.Hour
}
}) |
Beta Was this translation helpful? Give feedback.
Answered by
alicanerdurmaz
Oct 11, 2022
Replies: 1 comment
-
Thanks for your contribution. This bug fixed and merged. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
alicanerdurmaz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for your contribution. This bug fixed and merged.
The process can be following here Issue #2692.