angular-fullstack-graphql
angular-fullstack-graphql copied to clipboard
New posts not shown in the list without reload
I tried the angular-appollo example and it runs alright. However, changes made to the list of posts are not automatically reflected in the UI. If I for example add a new post from the UI, it doesn't add it to the feed without reload. If I change something on the server it doesn't either get pushed out, which I guess is due to no sw setup. But shouldn't a new post added in the UI update the feed at least?
Steps to reproduce:
- Start the angular-graphql/quickstart-with-apollo example locally.
- Go to localhost:3000 where you see a list of current posts.
- Click the "+ New Post" button in the top right corner
- On the /create page, create a new Post by adding a Description and an URL.
- Click Create and you are now redirected back to the list page.
Outcome: The list of post is shown, but the newly added post is not visible until after a reload. Expected outcome: The newly added post should be shown in the list
Further investigation: Delete one of the existing posts Outcome: The list of posts is shown with the deleted item removed, but the newly added post is still not visible. Expected outcome: The newly added post should be shown in the list
Debugging shows that ngOnInit is correctly called when redirected back to the feed view. However, the watchQuery subscribe results in an allPosts list that is not updated to the latest version.