Support Convex as DB integration #12146
Replies: 1 comment 1 reply
-
I am working on a solution, and i think the issue lies in payload.find, which is on server. The before*** hooks run on page reload, disconnecting Convex realtime clientside useQuery. To make this work on my end I had to replace the default List and Edit views, using the Convex useQuery to fetch and sync data, then formatting how payload likes, and passing it to their native ListView and EditView components. payload.find and related operations seem to happen on the server, and the actual EditView/ListView components are client components. In my opinion this requires a custom DB adapter (server side payload.find, ect operations) and overriding things like useListQuery (client side hook that fetches data from payload local api -> server). When saving a record it would go through payload.create -> db adapter -> add to convex The ListView would have an overridden useListQuery, which injects the convex useQuery hook, making the listview convex realtime. Still prototyping and would appreciate any direction. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Convex support real-time out of the box and has a fantastic frontend DX.
I think it can be a way out of the real-time issue discussed in #4191
Proposed Solutions,
Then the request flow will work like this
Beta Was this translation helpful? Give feedback.
All reactions