If use <page-query>
inside the index is working, but when I use it inside a component I get an error of "edges undefined".
Any help?
It's normal, In Gridsome when you query inside a component instead of <page-query>
you should use <static-query>
.
When using posts as alias (for example), your data will be available at $page.posts
usually but if you are using <static-query>
instead it will be available at $static.posts
As you can read here