Using live: true ,but cant Realtime queries

use this code , when a new record in database, it cant realtime queries the new record
const [{ data: taskRecord, fetching, error: fetchError }, reexecuteQuery] = useFindFirst(api.workTask, {
live: true,
filter: {
fatherId: {
equals: null
}
},
sort: [{ id: "Descending" }]
});
const [{ data: taskRecord, fetching, error: fetchError }, reexecuteQuery] = useFindFirst(api.workTask, {
live: true,
filter: {
fatherId: {
equals: null
}
},
sort: [{ id: "Descending" }]
});
but remove filter it can realtime queries
const [{ data: taskRecord, fetching, error: fetchError }, reexecuteQuery] = useFindFirst(api.workTask, {
live: true,
sort: [{ id: "Descending" }]
});
const [{ data: taskRecord, fetching, error: fetchError }, reexecuteQuery] = useFindFirst(api.workTask, {
live: true,
sort: [{ id: "Descending" }]
});
what's the problem:coding:
3 Replies
Chocci_Milk
Chocci_Milk6mo ago
I would recommand that you use the filter isSet: false instead of equals: null to see if that makes a difference
leshu
leshuOP6mo ago
using isSet: false ,but When new data is added, live query still cannot be implemented.
Chocci_Milk
Chocci_Milk6mo ago
Could you please check the network tab to make sure that the websocket is connected?

Did you find this page helpful?