Learning to connect Gatsby and Strapi - my first steps - HELP

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).,
( :memo: [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