Open mamach86 opened 5 years ago
Hello,
We just had the same problem, with offline disabled, and default fetch policy used. The query returns null even if it is working perfectly in appsync console. It works again if we disable offline and pt fetchPolicy to network-only
Hi all, we are having issues with our queries.
Do you want to request a feature or report a bug? Bug
What is the current behavior? When offline is enabled, with fetchPolicy set to
cache-first
and cache is empty, 90% of the time the query returns null, and no errors. When offline is disabled, the query works perfectly fine all the time.If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
First be sure your cache is empty so the offline query deos not give any results.
Then do a normal query with variables:
At this stage we are loggedIn and we do the query:
In the case it returns null we have the following result :
What is the expected behavior? When offline enabled with fetchPolicy set to
cache-first
, if the cache returns nothing, the query should behave like when offline mode is disabled. It seems that it returns null when it hits the empty cache instead of trying online, or something else goes wrong in between.Which versions and which environment (browser, react-native, nodejs) / OS are affected by this issue? Did this work in previous versions? We are using react-native and "aws-appsync": "^1.7.2"
Can anyone explain this ?
Thanks a lot for your help.