Skip to content

Conversation

dohomi
Copy link
Contributor

@dohomi dohomi commented Mar 20, 2018

Trying to solve #212 and probably some other issues where loading of undefined appears on Nuxtjs with child routes

@Akryum I'm not sure if this will solve the issue but I face exactly the issue where a getter on loading is called even though the queries is empty. I have this issue on call of historyBack() from child route back to parent page.

@dohomi
Copy link
Contributor Author

dohomi commented Mar 21, 2018

@Akryum so I tried now more extensively this PR in my current app and it fixes at least #212 but I'm not sure about side-effects.

The major issue I came across working with vue-apollo and Nuxt with the apollo-module is, that on state changes and historyBack() or routing on the same component with route.params you get your application into a state, where $apollo.queries is empty and thus you end up in undefined code and data is not properly set.

I am not sure how to really solve this issue. In my opinion the main issue with vue-apollo is, that $apollo is only connected and accessible on the current this context of one component and not on $root. Maybe if smartQueries would be available through the whole application code then the issue could be solved.

@dohomi
Copy link
Contributor Author

dohomi commented Mar 29, 2018

@Akryum did you got time to check this PR? its currently still an issue if the component structure is not cleaned up correctly that you bump into the #212 issue.

@rhangai
Copy link

rhangai commented May 18, 2018

I also have this problem, but the fixes proposed in this PR solves it perfectly. (And i think #266 is related)
This happens when i use nested routes.

@Akryum Akryum merged commit a9dffa3 into vuejs:master May 21, 2018
@Akryum
Copy link
Member

Akryum commented May 21, 2018

Thanks! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants