This error usually happens when you use the refetch
function in a TouchableOpacity
like this:
<TouchableOpacity onPress={refetch} ... />
.
The error happens because the onPress
attribute of TouchableOpacity
gets passed in a param, that graphql tries to use as variables but can't, since it is a cyclic structure.
Fix it by doing the following:
refetch()} ... />