Relay: [Feature] Implement @once directive

Created on 25 Oct 2019  路  3Comments  路  Source: facebook/relay

Once fragment has 'once' directive, all refetch queries get data from Relay Store and not from API.

Most helpful comment

use fetchPolicy to fix this

also read this to improve your cache strategy

https://medium.com/@helielson/caching-fields-on-relay-modern-with-hooks-30d76502e404

All 3 comments

@fedbalves Refetch container has fetchPolicy with store-or-network value. Is this what are you looking for? https://relay.dev/docs/en/refetch-container#arguments-1

@fedbalves Refetch container has fetchPolicy with store-or-network value. Is this what are you looking for? https://relay.dev/docs/en/refetch-container#arguments-1

Maybe. I'll look into it.
Thanks

use fetchPolicy to fix this

also read this to improve your cache strategy

https://medium.com/@helielson/caching-fields-on-relay-modern-with-hooks-30d76502e404

Was this page helpful?
0 / 5 - 0 ratings