Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error graphQl run dev #30

Open
kmytor opened this issue Aug 31, 2022 · 0 comments
Open

Error graphQl run dev #30

kmytor opened this issue Aug 31, 2022 · 0 comments

Comments

@kmytor
Copy link

kmytor commented Aug 31, 2022

Hello, I want to thank you in advance for this gridsome, and I want to use it a lot because I think it is very good to manage graphQl.
but I have had a lot of problems to get it to work at the time of run dev:
this is my mistake:

`ridsome v0.7.23

Initializing plugins...
Load sources - 0.06s
Create GraphQL schema - 0.07s
Create pages and templates - 0.06s
Generate temporary code - 0.11s
Bootstrap finish - 1.55s

ERROR Failed to compile with 1 errors 9:49:08 a. m.

error in ./src/pages/Index.vue?vue&type=custom&index=0&blockType=page-query

Module build failed (from ./node_modules/gridsome/lib/plugins/vue-components/lib/loaders/page-query.js):
Error: Cannot query field "allWordPressPost" on type "Query".

GraphQL request:3:3
2 | query Post{
3 | posts: allWordPressPost {
| ^
4 | edges {
at Object.module.exports (C:\laragon\www\demog-rid\wp-content\themes\grid-theme\node_modules\gridsome\lib\plugins\vue-components\lib\loaders\page-query.js:33:23)

@ ./src/pages/Index.vue?vue&type=custom&index=0&blockType=page-query 1:0-331 1:347-350 1:352-680 1:352-680
@ ./src/pages/Index.vue
@ ./src/.temp/routes.js
@ ./node_modules/gridsome/app/router.js
@ ./node_modules/gridsome/app/entry.sockjs.js
@ multi webpack/hot/dev-server webpack-hot-middleware/client?name=app&reload=true&noInfo=true ./node_modules/gridsome/app/entry.client.js ./node_modules/gridsome/app/entry.sockjs.js`

this is my configuration in gridsome.config.js
`
module.exports = {
siteName: 'demo-gridsome',
plugins: [
{
use: '@gridsome/source-graphql',
options: {
url: 'http://demo-gridsome-theme.test/graphql',
splitPostsIntoFragments: true,
downloadRemoteImagesFromPosts: true,
downloadRemoteFeaturedImages: true,
downloadACFImages: true,
},
},

],
}
`
can you help me what configuration I am missing

<div class="demo">
  <h1> posts inicial xxx</h1>
  <ul>
    <li v-for="{node} in $static.posts.edges" :key="node.id">
      {{node.title}}
    </li>
  </ul>
</div>
query Post{ posts: allWordPressPost { edges { node { id title } } } }
@kmytor kmytor changed the title error Error graphQl run dev Aug 31, 2022
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

No branches or pull requests

1 participant