-2

code

nuxt

I am trying to get my data with APOLLO and show them on the page with v-for. However, i can access the data, even though i can see them in the vue console. What am i missing?

I also tried v-for="post in data.posts.nodes", with no luck..

SBweb
  • 7
  • 3
  • 3
    [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) - *DO NOT post images of code, data, error messages, etc* – Michal Levý Mar 26 '22 at 08:12
  • Please. don't post the code as images. Don't use console to debug. See https://stackoverflow.com/questions/23392111/console-log-async-or-sync – Estus Flask Mar 26 '22 at 08:12

1 Answers1

0

Right now you are calling the apollo query in the parent component (index.vue) and are trying to access data in the child component (Tutorial.vue)

You can pass data to the Tutorial component as a prop or take Apollo query into the Tutorial component.

Pasting the following code into your index.vue, should render your data.

<li v-for="post in post.nodes" :key="post.id" >{{post.title}}</li>
Elar Saks
  • 151
  • 5