Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serverless App demo. #141

Open
ghost opened this issue May 12, 2022 · 7 comments
Open

Serverless App demo. #141

ghost opened this issue May 12, 2022 · 7 comments

Comments

@ghost
Copy link

ghost commented May 12, 2022

Is it possible to get a SvelteKit (or NextJS, Nuxt ) PostgreSQL / Supabase demo?

@ghost ghost changed the title Is it possible to get a SvelteKit (or NextJS, Nuxt )PostgreSQL / Supabase demo? Serverless App demo. May 12, 2022
@ghost
Copy link
Author

ghost commented May 20, 2022

Also a GraphQL example would be cool.

@aboodman
Copy link
Contributor

GraphQL and Replicache don't really go together. The Replicache sync protocol takes the spot that GraphQL usually does.

@ghost
Copy link
Author

ghost commented May 20, 2022

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?

@aboodman
Copy link
Contributor

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.

@aboodman
Copy link
Contributor

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.

@ghost
Copy link
Author

ghost commented May 20, 2022

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.

@aboodman
Copy link
Contributor

Yep, you could do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant