draftbox-co / gatsby-attila-theme-starter

A Gatsby starter for creating blogs from headless Ghost CMS.
https://ghost-attila.draftbox.co/
MIT License
7 stars 2 forks source link

Cannot query field "localFeatureImage" on type "GhostPage" #9

Open hashtd opened 4 years ago

hashtd commented 4 years ago

after cloning repo added Ghost 3.0 cms contentApiKey but if gives following error

warn Plugin @draftbox-co/gatsby-theme-ghost-attila is not compatible with your gatsby version 2.24.80 - It requires gatsby@2.20.24
success open and validate gatsby-configs - 0.094s
warn Plugin @draftbox-co/gatsby-plugin-css-variables is not compatible with your gatsby version 2.24.80 - It requires gatsby@2.20.24
warn Plugin @draftbox-co/gatsby-theme-ghost-attila is not compatible with your gatsby version 2.24.80 - It requires gatsby@2.20.24
success load plugins - 0.355s
success onPreInit - 0.025s
success delete html and css files from previous builds - 0.003s
success initialize cache - 0.007s
success copy gatsby files - 0.014s
warn gatsby-plugin-feed was initialized in gatsby-config.js without a title in a feed.
This means that the plugin will use the default feed title, which may not match your use case.
This behavior will be removed in the next major release of gatsby-plugin-feed.
For more info, check out: https://gatsby.dev/adding-rss-feed
success onPreBootstrap - 1.738s
success createSchemaCustomization - 0.011s
success Checking for changed pages - 0.008s
success source and transform nodes - 2.550s
warn Plugin `@draftbox-co/gatsby-theme-ghost-attila` has customized the GraphQL type `GhostPost`, which has already been defined by the plugin `gatsby-source-ghost`. This could potentially
warn Plugin `@draftbox-co/gatsby-theme-ghost-attila` has customized the GraphQL type `GhostPage`, which has already been defined by the plugin `gatsby-source-ghost`. This could potentially
success building schema - 0.392s
info Total nodes: 74, SitePage nodes: 5 (use --verbose for breakdown)
success createPages - 0.041s
success Checking for changed pages - 0.001s
success createPagesStatefully - 0.062s
success update schema - 0.024s
success onPreExtractQueries - 0.003s

 ERROR #85923  GRAPHQL

There was an error in your GraphQL query:

Cannot query field "localFeatureImage" on type "GhostPage".

If you don't expect "localFeatureImage" to exist on the type "GhostPage" it is most likely a typo.
However, if you expect "localFeatureImage" 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 "localFeatureImage" 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 "GhostPage":
https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions

File: node_modules/@draftbox-co/gatsby-theme-ghost-attila/src/templates/pageTemplate.jsx:347:7

 ERROR #85923  GRAPHQL

There was an error in your GraphQL query:

Cannot query field "localFeatureImage" on type "GhostPost".

If you don't expect "localFeatureImage" to exist on the type "GhostPost" it is most likely a typo.
However, if you expect "localFeatureImage" 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 "localFeatureImage" 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 "GhostPost":
https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions

File: node_modules/@draftbox-co/gatsby-theme-ghost-attila/src/templates/postTemplate.amp.jsx:112:7

 ERROR #85923  GRAPHQL

There was an error in your GraphQL query:

Cannot query field "localFeatureImage" on type "GhostPost".

If you don't expect "localFeatureImage" to exist on the type "GhostPost" it is most likely a typo.
However, if you expect "localFeatureImage" 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 "localFeatureImage" 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 "GhostPost":
https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions

File: node_modules/@draftbox-co/gatsby-theme-ghost-attila/src/templates/postTemplate.jsx:371:7

failed extract queries from components - 0.480s
thandaanda commented 3 years ago

Hi @hashtd ,

One of the issues could be there are no featured images in any of your posts on Ghost. Can you send us a minimal reproducible repo to investigate it further.

Trent71 commented 3 years ago

Similar issue as hashtd. Steps to reproduce: follow the readme exactly as stated.

I did:

  1. gatsby new try-ghost https://github.com/draftbox-co/gatsby-attila-theme-starter
  2. cd try-ghost
  3. gatsby develop
  4. visit site at http://localhost:8000.

Upon visiting http://localhost:8000 I got the following error (Chrome):

"This site can’t be reached localhost refused to connect."

The cmd window shows text similar to what hashtd posted.

Another note: As far as I can tell this repo requires Gatsby 2.20.24 for plugins, and gatsby@^2.27.0 for other plugins.