Describe the bug
When using the nested UI queries as announced here, the where clause is not passed to the queryFn via loadSubsetOptions. This means all the data needs to be fetched thus eliminating the benefits of partial data fetching.
To Reproduce
const root = createCollection(
queryCollectionOptions({
queryKey: ['root'],
syncMode: 'on-demand',
queryFn: async (context) => {
return getRoots();
},
queryClient,
getKey: (item) => item.id,
})
);
const items = createCollection(
queryCollectionOptions({
queryKey: ['root-items'],
syncMode: 'on-demand',
queryFn: async (context) => {
const { filters } = parseLoadSubsetOptions(
context.meta?.loadSubsetOptions
);
const rootId = filters[0].value; // <- This is never defined
const items = await getRootItems(filters[0].value)
},
queryClient,
getKey: (item) => item.id,
})
);
const collection = await queryOnce((q) => {
const c = q
.from({ r: root })
.select(({ r }) => ({
id: collection.id,
name: collection.title,
children: toArray(
q
.from({ items: items })
.where(({ items }) => eq(items.rootId, r.id))
.select(({ items }) => ({
id: items.id,
type: items.type,
name: items.title,
}))
),
}));
return c;
});
Expected behavior
rootId should be defined in the queryFn
Desktop (please complete the following information):
- OS: [e.g. iOS]: macOS Tahoe 26.2
- Browser [e.g. chrome, safari]: chrome
- Version [e.g. 22]: 146.0.7680.167
Additional context
Add any other context about the problem here.
Describe the bug
When using the nested UI queries as announced here, the where clause is not passed to the
queryFnvialoadSubsetOptions. This means all the data needs to be fetched thus eliminating the benefits of partial data fetching.To Reproduce
Expected behavior
rootIdshould be defined in thequeryFnDesktop (please complete the following information):
Additional context
Add any other context about the problem here.