Also created an issue on relay repo since I am not sure if this is a relay or react-native problem: https://github.com/facebook/relay/issues/1028
I am currently using relay together with react-native.
I have found that whenever I make a change to GraphQL schema, there is a hidden cache somewhere that needs to be manually invalidated for the Relay.QL defined for Relay containers.
I have tried these steps to clear cache:
These are not enough and still causes invalid relay query error.
I think that I would have to make some changes to all Relay.QL fragments that require change while running react-native packager to invalidate the hidden caches.
I wish there is a easy way to clear all caches and start from scratch.
I am not sure if this is relay or react-native problem.
I have seen this issue. I usually find myself doing rm -rf $TMPDIR/react-* which invalidates the cache but def. not an ideal solution.
cc @skevy thoughts?
Doing rm -rf $TMPDIR/react-* did not work for me :(
Run the packager with --reset-cache.
Yah, FWIW, rm -rf $TMPDIR/react-* doesn't do anything. As far as I'm aware, the packager doesn't store anything useful there anymore. --reset-cache is what you want.
Will try!
@skevy wow! i always did rm -rf $TMPDIR/react-*with --reset-cache. Never realised rm was not doing anything!
I confirm that running react-native start --reset-cache indeed solves this problem!
Thank you all!
Most helpful comment
Run the packager with
--reset-cache.