wasyl
12/15/2020, 6:43 PMCacheKeyResolver
and fromFieldRecordSet
and fromFieldArguments
methods?
fromFieldRecordSet
seems like it asks for cache key for every object (non-scalar) in the response? But what does fromFieldArguments
do?mbonnin
12/15/2020, 6:52 PMquery AuthorById($id: String!) {
author(id: $id) {
id
name
}
}
}
fromFieldArguments
tells the cache to use the id from the argumentsfromFieldRecordSet
tells the cache to use the id from the responsewasyl
12/15/2020, 6:58 PMfromFieldArguments
has preference over fromFieldRecordSet
when computing cache for the object directly under a field?
In your example, if fromFieldArguments
returns the ID, does fromFieldRecordSet
still need to run?mbonnin
12/15/2020, 7:03 PMfromFieldArguments
will run before the network to check if there's something in the cache. fromFieldRecordSet
will run after to store the value in the cachewasyl
12/15/2020, 7:12 PM