question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Possible Redux/caching error - renders AppSync unusable

See original GitHub issue

I’m getting this error

Error sending the query '<name>' Error: Can't find field <name> on object (ROOT_QUERY) undefined

I’m not sure what I’m doing wrong, but I did notice appsync in the Redux store is an empty object. Seems like the cache is trying to read from something that isn’t there.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:17 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
ffxsamcommented, Jan 29, 2018

I take it back, the above solution is no good. It causes problems with Vue DevTools because it expects the DOM to be there and it’s not right away.

So I went with this solution:

In App.vue, in the script block:

  data() {
    return {
      hydrated: false,
    };
  },

  async mounted() {
    await this.$apollo.provider.defaultClient.hydrated();
    this.hydrated = true;
  },
});

Then simply make sure the root div in App is <div v-if="hydrated"> so that nothing mounts until hydration is complete.

2reactions
nicokrugercommented, Jan 31, 2018

Thanks @manueliglesias, you saved me from pulling my hair out 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Caching and compression - AWS AppSync
AWS AppSync's server-side data caching capabilities make data available in a high speed, in-memory cache, improving performance and decreasing latency.
Read more >
Redux Essentials, Part 7: RTK Query Basics
RTK Query is a powerful data fetching and caching tool. ... use the status booleans and the data/error fields to render the UI...
Read more >
Cache Behavior
When data is fetched from the server, RTK Query will store the data in the Redux store as a 'cache'. When an additional...
Read more >
Redux Essentials, Part 8: RTK Query Advanced Patterns
It's possible for the result argument in these callbacks to be undefined if the response has no data or there's an error, so...
Read more >
Automated Re-fetching
Note that either the result or error arguments may be undefined based on whether the mutation was successful or not. Cache tags​. RTK...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found