Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Add support for database in library. #159

Open
Lavanyagaur22 opened this issue Oct 2, 2019 · 3 comments
Open

Add support for database in library. #159

Lavanyagaur22 opened this issue Oct 2, 2019 · 3 comments

Comments

@Lavanyagaur22
Copy link
Collaborator

Lavanyagaur22 commented Oct 2, 2019

Feature Request

To support offline mutations even when the app is closed, we need to persist the mutation requests in the database.

  • Implement a database (using SQLite or room) that stores the mutation requests made when the user goes offline.
  • For this you have to understand:
    • How the interceptor works and what are the type of objects in the request.
    • Store that request in a database after serializing it accordingly.
    • Extract data from the database (de-serialize it) to form a request object when the network connection is regained and a call to the server can be made.

This link can help you in understanding the apollo interceptor which we have used in intercepting the mutation requests: https://github.com/apollographql/apollo-android/blob/master/apollo-runtime/src/main/java/com/apollographql/apollo/interceptor/ApolloInterceptor.java#L114

@Lavanyagaur22 Lavanyagaur22 changed the title [Investigation] Add support for database in library. Add support for database in library. Oct 2, 2019
@nsalazar0429
Copy link

This issue sounds challenging. I would like to try it

@harshithdwivedi
Copy link
Collaborator

Sounds great!
@cfsnsalazar, keep us posted if you manage to figure out an effective way of serializing the request object that's present in the interceptor.

We need to store it to the db :)

@nsalazar0429
Copy link

Sorry, I have not been able to work on this issue

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

No branches or pull requests

3 participants