repliear
repliear copied to clipboard
Serverless App demo.
Is it possible to get a SvelteKit (or NextJS, Nuxt ) PostgreSQL / Supabase demo?
Also a GraphQL example would be cool.
GraphQL and Replicache don't really go together. The Replicache sync protocol takes the spot that GraphQL usually does.
Interesting. For example, I used FaunaDB for an application and I interact with it using GraphQL. Does this mean that I cannot use Replicache for offline real time syncing?
You would need to put an application server in front of fauna (perhaps a lambda would do) to implement the Replicache push and pull endpoints. See: https://doc.replicache.dev/how-it-works#the-big-picture. This is fairly easy to do. Additionally for each Replicache mutator (https://doc.replicache.dev/how-it-works#push) you need to implement the corresponding mutation code for Fauna. Most apps don't have a very large number of mutators so this isn't a big deal.
Most people find Replicache easier to use than GraphQL 😂 so they don't really mourn the loss. Once you have sync setup you can kind of forget the server exists much of the time and program entirely on the client.
You would need to put an application server in front of fauna (perhaps a lambda would do) to implement the Replicache push and pull endpoints. See: https://doc.replicache.dev/how-it-works#the-big-picture. This is fairly easy to do. Additionally for each Replicache mutator (https://doc.replicache.dev/how-it-works#push) you need to implement the corresponding mutation code for Fauna. Most apps don't have a very large number of mutators so this isn't a big deal.
Okay but as far as I understood these docs, it would be possible in my situation. Is this correct?
I could implement pull and push endpoints and then just run graphql queries instead of sql on the server side.
Yep, you could do that.