Bonjour,
as an old pythonist ,back to web XXI century standards, I made a choice on Strapi (very very good for me) + frontend Gatsby.
I spent a lot of time attempting to follow the tutorial for this (create a blog with Str. & Gy).,
( [Building a Static Blog using Gatsby and Strapi](https://đ Building a Static Blog using Gatsby and Strapi) )
coding on base of thevideos + the code-snippets provided.
Iâm stuck, and afraid I wonât get out of it without help.
My Strapi cms is working, my Gatsby blog frontend is working, but the Query âallStrapiArticlesâ is definitely not available toGraphiQL or to Gatsby config. I 'm sure my permissions/roles are OK.
If needed, Iâm ready to expense for some initiation on this combinated platform.
I am now trying via another tuto:
I launched
$ gatsby new gatsby-app from pydsuperu@AlPoudre:~/Documents/Strapi/2021-02-Proj4
info Creating new site from git:
github.com/gatsbyjs/gatsby-starter-default.git
error claimed:
Failed to compile
There was an error in your GraphQL query:
Cannot query field âallStrapiRestaurantâ on type âQueryâ.
If you donât expect âallStrapiRestaurantâ to exist on the type âQueryâ it is most likely a typo.
However, if you expect âallStrapiRestaurantâ 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 âallStrapiRestaurantâ 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 âQueryâ:
https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions
File: /home/pydsuperu/Documents/Strapi/2021-02-Proj4/gatsby-app/src/pages/index.js
This error occurred during the build time and cannot be dismissed.
My project is baking here (public access):
https:__github.com/PY-Delens/2021-02-Proj4
In conclusion, I need interactive help on basis of ONE good tutorial going through it despite gotchas.
Thanks on forward
Pierre-Yves Delens
I will try to help, but Iâm also just beginning with Strapi. First thing I would check is your permissions under Settings and then Roles and Permissions. Click on the Public role and make sure that find and findone are checked for your content-type. (Check this tutorial under Allow access - Create a food ordering app with Strapi and Next.js 2/7 )
The other thing to check is do you have access to the GraphQL playground at http://localhost:1337/graphql â if you do, then you can start debugging your problems there. If you donât have access, then you know that thereâs something wrong with GraphQL and maybe it wasnât installed properly.
Iâm having a similar issue.
On Gatsby build, I have this error:
error Cannot query field "global" on type "Query" graphql/template-strings
A first step is to check if the query is correct.
GraphQL playground is great to identify the query issues: they will be highlighted with a red segment, with a hovering message: Playground - http://localhost:1337/graphql
Doing so, I was able to clean the query, that I exactly pasted in Gatsby.
However, I still have the issue, that must be Gatsby related since itâs fine in GraphQL playground.
From there, I have absolutely no idea how to solve it
Hello there, sometimes It always expects a result to be filled, at least for one of allStrapiArticles.
Or you can read https://www.gatsbyjs.com/docs/reference/graphql-data-layer/schema-customization/#creating-type-definitions