graphql-platform icon indicating copy to clipboard operation
graphql-platform copied to clipboard

Generated component displays data only once with default execution strategy

Open elishnevsky opened this issue 3 years ago • 1 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

Product

Strawberry Shake

Describe the bug

If data returned by a GraphQL query doesn't change between calls, then its generated <Use... /> component with default execution strategy (NetworkOnly) displays the data only the first time it's accessed. If you navigate away from a page with the component and come back, the call to the GraphQL API end-point is made, but the data is not displayed.

Steps to reproduce

  1. Write a query that will always return the same data (for example crypto names only)
  2. Run dotnet build to generate code
  3. Put the generated <Use... /> component on a page and provide content for ChildContent (do not change the default execution strategy)
  4. Run the app and navigate to that page (API call returns data which is displayed correctly)
  5. Navigate away and come back to the page (API call returns the same data as before, but it is not displayed)

Relevant log output

No response

Additional Context?

Here's a simple app I've created to reproduce the issue: https://github.com/elishnevsky/StrawberryShakeBug

Version

13.0.0-rc.0

elishnevsky avatar Jan 20 '23 23:01 elishnevsky

Have the same issue on 13.0.2 Problem only occurs on ExecutionStrategy.NetworkOnly. If ExecutionStrategy.CacheFirst or ExecutionStrategy.CacheAndNetwork is used it behaves as expected.

zc0rp10 avatar Feb 16 '23 12:02 zc0rp10