styxlab / gatsby-theme-try-ghost

A Gatsby theme to build flaring fast blogs from headless Ghost CMS
MIT License
136 stars 56 forks source link

fix sharp image not linked to node #261

Closed hasanlussa closed 3 years ago

hasanlussa commented 3 years ago

image fields not returning remote file fields, it's returning raw node id instead. Query using image fields will return this kind of error, because it's string

image

Solution

gatsby-source-filesystem require linked node to add ___NODE on end of field.

styxlab commented 3 years ago

This may solve your specific problem but is not a general solution. I had the ___NODE extension included in earlier versions - it's only needed if you do not explicitly define a custom schema. The schema, in this monorepo comes from gatsby-source-try-ghost - are you using gatsby-plugin-ghost-images as part of another stack? If so, you need to define a custom schema that makes the links explicit.

hasanlussa commented 3 years ago

This may solve your specific problem but is not a general solution. I had the ___NODE extension included in earlier versions - it's only needed if you do not explicitly define a custom schema. The schema, in this monorepo comes from gatsby-source-try-ghost - are you using gatsby-plugin-ghost-images as part of another stack? If so, you need to define a custom schema that makes the links explicit.

aah ok :smiley:, i found this plugin on gatsby plugin registry, and i do not use gatsby-source-try-ghost, i'm using the official gatsby-source-ghost. Ok i will close this PR then.

Thank you, it's great plugin btw.

styxlab commented 3 years ago

aah ok smiley, i found this plugin on gatsby plugin registry, and i do not use gatsby-source-try-ghost, i'm using the official gatsby-source-ghost. Ok i will close this PR then.

That explains it. When you switch to gatsby-source-try-ghost everything should work as expected. Thanks for the heads-up :smiley: