简体   繁体   中英

How to update local data from rxdb to server database postgrasql through graphql in react

we are trying rxdb as local database and postgresql as a server database and through graphql end point we are able to push and pull data from local to server and vice-versa but how to update and delete data so that it can replicate in both databases.

We tried with the graphql schema exactly same in rxdb. We have written pull and push requests using graphql end point, and we created rxdb documents name in database as on same as in the back-end database table for which we are writing push pull queries.

  • Create graphql endpoint with database and back-end.
  • Create database collection document in rxdb with the same name as in server/back-end database.
  • Take queries from the graphql endpoint and create the same schema in rxdb data document collection.
  • Write push and pull queries using graphql end point queries syncing with rxdb document data collection.

Read document for the exact code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM