Let's say I have a list of shrinked items with users ID. By clicking on them I want to lazy load data with apollo query, expand and show received data, for example username, address, etc. So how should I "cache" or store this data locally, to be able to reload + append new user data and also show already loaded users from local state, not reloading them from server
Hypothetical query with hypothetical behavior:
export default {
apollo: {
getUser: {
query: gpl`query getUser($id: Int!) {
getUser(id: $id) {
username
address
}
}`,
onDataLoaded: data => this.storedUsers.concat(data) // smthg lk ths
}
},
data () {
return {
storedUsers: []
}
}
}
Or maybe this is a bad approach?