builder
builder copied to clipboard
Query in fetchEntries() won't work in SvelteKit
Describe the bug
A couple of weeks ago, we noticed that when using the SvelteSDK above 1.0.26, we would run into issues with our query passed to fetchEntries.
To Reproduce Steps to reproduce the behavior:
- Create a data model in builder.io and assign start and end dates to schedule the data entry for expiry. Make sure it is currently live.
- Fetch this data model in SvelteKit using the
fetchEntriesfunction. Pass the following query to fetch all currently live entries as well as all entries where nostartDateand noendDatehave been set:
$or: [
{
$and: [{ startDate: { $lte: Date.now() } }, { endDate: { $gte: Date.now() } }],
},
{
$and: [{ startDate: { $exists: false } }, { endDate: { $exists: false } }],
},
],
-
fetchEntrieswill return an empty array.
Expected behavior
fetchEntries should return currently live entries.
Screenshots If applicable, add screenshots to help explain your problem.
Additional context I suspect this has something to do with the changes: https://github.com/BuilderIO/builder/issues/3007