Hi all,
I’m working on my next blog which is Gatsby authentication with Strapi.
I’m using this strapi-starter-gatsby-blog as my starting point which is inside an official Strapi repo. But I’m running into GraphQL query issues which I assume is due to the latest changes in the Gatsby version. I’m attaching the screenshot of the errors. I’m very new to GraphQL so it’s taking me some time to debug this.
Meanwhile, if anyone can point out what could go wrong here. It would really expedite the blog writing part. Thank you!
I followed the README instructions mentioned on the above repo.
Step 1: yarn create strapi-starter my-site gatsby-blog
Step 2: Run npm run develop
from the root which will run both the repos. Backend Started as expected at localhost://1337
. But the frontend fails because it isn’t able to query collections.
Error encountered:
File: src/pages/category/{StrapiCategory.slug}.js:9:46
GraphQLError: Field "category" is not defined by type "StrapiArticleFilterInput".
---
There was an error in your GraphQL query:
Cannot query field "image" on type "StrapiArticle".
File: src/pages/article/{StrapiArticle.slug}.js:16:7
---
Cannot query field "author" on type "StrapiArticle".
File: src/pages/article/{StrapiArticle.slug}.js:22:7
---
Cannot query field "author" on type "StrapiArticle".
File: src/pages/index.js:50:11
---
Can't resolve '../../public/page-data/sq/d/2852343550.json' in '/home/purnima/projects/gatsby_strapi/my-site/frontend/src/pages'
More Info on the version:
-
Gatsby CLI version installed on ubuntu 20.04: Gatsby CLI version: 3.5.0
-
Gatsby’s version inside the above repo’s
package.json
file: “version”: “0.1.0”,