I am using Apollo Normalized SQL Cache for caching the user data such as user id, name and phone number in Android. Is there a way that I could fetch that information whenever I need irrespective of the query being fired or not?
The response of the query stored in cache.
query loginUser($mobile: String!, $password: String!) {
login(mobile: $mobile, password: $password){
token
id
}
}
ApolloClient.java
public class OtherAplClient {
public static final String BASE_URL = AplClient.BASE_URL;
public static ApolloClient getmApolloClient() {
OkHttpClient okHttpClient = new OkHttpClient.Builder().build();
return ApolloClient.builder()
.serverUrl(BASE_URL)
.okHttpClient(okHttpClient)
.build();
}
}
Here I want to read the cache
ApolloClient apolloClient = OtherAplClient.getmApolloClient();
// Here I want to read the cache