You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's say you have a normal query (https://ferrygraphql.com/docs/queries) but you wish to programatically update the data, depending on some other logic; how can this be done?
Or even build a request with som predefined data / set the cache with some predefined data?
The issue is that I have a query to fetch all genres, and for each genre, there's 10 movies. When you scroll further in the movie list, I need to load 10 more movies (but not 10 more genres).
One way to achieve this would be to have a query to fetch movies for a genre; and when you fetch the genres list, the cache for the queries to fetch movies is set to the data from the genres query.
The text was updated successfully, but these errors were encountered:
Yes, there are multiple points where you could hook in.
I'm not sure what your schema and queries look like, so it's difficult to give concrete advice.
But general pointers are:
The .request() method returns a stream, and the stream keeps listening to cache updates.
So you can
manually update cache data using cache.writeQuery(), cache.writeFragment()
Let's say you have a normal query (https://ferrygraphql.com/docs/queries) but you wish to programatically update the data, depending on some other logic; how can this be done?
Or even build a request with som predefined data / set the cache with some predefined data?
The issue is that I have a query to fetch all genres, and for each genre, there's 10 movies. When you scroll further in the movie list, I need to load 10 more movies (but not 10 more genres).
One way to achieve this would be to have a query to fetch movies for a genre; and when you fetch the genres list, the cache for the queries to fetch movies is set to the data from the genres query.
The text was updated successfully, but these errors were encountered: