Skip to content

Any best practices on naming queries and fragments and query reuse? #1495

Answered by JoviDeCroock
RIP21 asked this question in Q&A
Discussion options

You must be logged in to vote

When you use the normalized cache and your fields are in the cache it should be a hit, sometimes the cache will need some additional information. Like when you have a list-view and you go to the detail-view of one of the items, you can solve this with cache.resolve as documented here.

So generally if the schema tells us a field is nullable and missing --> we'll fetch it and mark your query as stale
If the fields are in cache for the given query we'll give you the information

When the root field doesn't know the connection, for instance Query.todos vs Query.todo(id: x) we can use the cache.resolve technique.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@RIP21
Comment options

@JoviDeCroock
Comment options

@RIP21
Comment options

@JoviDeCroock
Comment options

@RIP21
Comment options

Answer selected by RIP21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants