Everything was working well, I had created a content type of Job and could query this with allStrapiJobs but today I edited one of the Jobs content and suddenly I was getting an error saying it couldn’t find allStrapiJobs. I checked in GraphiQL and allStrapiJobs has indeed disappeared. I’ve made no changes to configuration, I’ve double checked permissions and it has “find” and “find one” both ticked. I’ve tried restarting Gatsby and Strapi local dev servers but this hasn’t helped.
I’ve tried running the command ‘gatsby develop’ again but it still doesn’t appear. I’m still at the beginning of development work so I’ve not used ‘gatsby build’ yet. I’m assuming I shouldn’t run ‘gatsby build’ yet, am I correct or will this command help with the issue?
No, allStrapiJobs appeared in the Explorer panel of localhost:8000/___graphql after I had created the content type of Job in the Strapi admin and connected Gatsby with Strapi by adding the following in gatsby-config.js:
{
resolve: gatsby-source-strapi,
options: {
apiURL: http://localhost:1337,
queryLimit: 1000,
contentTypes: [jobs, projects, blogs],
singleTypes: [about],
},
},
In package.json > dependencies > looking for “gatsby-source-strapi”: “^0.0.12”, if it not there or it 0.0.0 version , add manualy this “gatsby-source-strapi”: “^0.0.12” and npm i in your cmd
Seeing similar issues over here. Tried both the 0.0.12 and @alpha build as suggested on the gatsby-source-strapi readme.
Currently the fronted fails building with this error:
Encountered an error trying to infer a GraphQL type for: localFile___NODE. There is no corresponding node with the id field matching: "0eeaaf7e-ead4-5290-abe8-b00b6e26c339"
I don’t have the word localFile anywhere in my repo and it only appears in the following node_modules: gatsby-source-strapi & import-local
Running gatsby clean doesn’t seem to help either. I’m running gatsby build --no-uglify when this happens…
I manually removed node_modules/import-local and the error remains, so the culprit is most definitely the gatsby-source-strapi plugin. I’ll investigate some more and open an issue on their repo if none exists already.
Ok, so apparently the @alpha version is only going to work well with Gatsby v3 (not released yet), so going back to 0.0.12
The reason I tried the alpha version is that I have flickering GraphQL errors when using version 0.0.12: one time it fails, telling me there’s no url field on any image relation I have. To continue, I have to adjust all graphql statements to use publicURL instead. However, the next build will fail, claiming that there’s no publicURL field on any image relation I have, and I have to change all graphql statements back to using url.
I’m pretty sure this is related to how Gatsby uses both server side rendering and client side rendering and there’s somehting going wrong in between. I am however no expert whatsoever in this domain…