marguerrrite / gatsby-prismic-starter-prist

Gatsby starter for portfolios and blogs using Prismic CMS
MIT License
344 stars 70 forks source link

There was an error in your GraphQL query: #37

Open catarinacbh opened 3 years ago

catarinacbh commented 3 years ago

Followed the steps as in Readme. Getting this error - tried ´gatsby clean`etc. no luck so far

 ERROR #85923  GRAPHQL

There was an error in your GraphQL query:

Cannot query field "allHomepages" on type "PRISMIC".

If you don't expect "allHomepages" to exist on the type "PRISMIC" it is most likely a typo.
However, if you expect "allHomepages" to exist there are a couple of solutions to common problems:

- If you added a new data source and/or changed something inside gatsby-node.js/gatsby-config.js, please try a restart of your development server
- The field might be accessible in another subfield, please try your query in GraphiQL and use the GraphiQL explorer to see which fields you can query and what shape they have
- You want to optionally use your field "allHomepages" and right now it is not used anywhere. Therefore Gatsby can't infer the type and add it to the GraphQL schema. A quick fix is to add at least one
entry with that field ("dummy content")

It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don't have to add the mentioned "dummy content". Visit our docs to learn how you can define the
schema for "PRISMIC":
https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions
azmansalleh commented 3 years ago

Ensure you created a new document based on the custom types defined

salsa-project commented 3 years ago

1- create Homepage, Post, Project 2- and content to them (at least 1) .. and save content and publish it 3- run gatsby clean 4- gatsby develop

Hope this helps :)