Closed GermainGirndt closed 3 years ago
@GermainPereira Can you please check the generated query fragments in the project directory. Are the missing fields present there?
@ynnoj Yes, there are missing fragments there as well as the fragments that shouldn't be there (I've already deleted the Homepage relation with the slideHeaders but it's still there).
I've deleted the graphcms-fragments folder and it ran perfectly! It seems like the GraphQL plugin can't fetch automatically the Schema changes for some reason.
Thank you for the fast answer!
@GermainPereira That's great!
The generated fragments are what the source plugin uses in queries to fetch data from GraphCMS and subsequently create the Gatsby nodes during the build. These can be configured (i.e. removing or adding fields) and as a result are not automatically re-generated following any remote schema changes. As you've figured out, you can remove the directory and they'll be regenerated but you'll lose any custom fields.
You should check these fragments into your version control (along with source code) and maintain them alongside your GraphCMS project. Hope this helps!
I'm evaluating GraphCMS for my company using the
gatsby-source-graphcms
plugin for fetching data from a GraphCMS endpoint, for now public available at https://api-us-east-1.graphcms.com/v2/ckh67cd5i176t01z23h0fe7dy/masterGraphCMS's Graphiql playground ist working perfectly well for all needs.
Still, I faced some issues while fetching/accessing data from the GraphCMS API using Gatsby locally:
1) Gatsby DID work pretty well fetching and showing the models. Still, some model's fields aren't there: for instance, it couldn't find most fields related my Homepage model (foreign key), as shown in the images bellow.
Homepage model with many fields
Most fields are not there
And not here too:
2) I made some experiments to try to figure out the problem source and I end up excluding the Foreign Key relation between the Homepage and SlideHeader models.
Since I made it, I'm running in the error
Error: Schema customization failed to find remote field SlideHeader.homepage
using Gatsby, although everything seems to work pretty well using GraphCMS's online Graphiql playground.I've already tried cleaning the (i) cache and (ii) updating some packages locally, (iii) commenting some other gatsby plugins, (iv) republishing and (v)updating my project's contents at graphcms.com and (vi) cloning the GraphCMS project and using the new API's url, but nothing seems to work.
I'm suspecting it's an intern error from the GraphCMS GraphQL API by deleting/renaming models and it's relations.
Gatsby's complete log running
gatsby develop
:Dependencies in the package.json file
configs in the gatsby-config.js file (I commented some for test purporses)