Content type fields not showing on GraphQL API

System Information
  • Strapi Version: 4.0.0
  • Operating System: Windows 10
  • Database: SQLite
  • Node Version: 16.13.1
  • NPM Version: 7.24.0
  • Yarn Version: 1.22.5

Hi all,

I’ve created a new Strapi (v4) project and have set up my content types and added data for all the available fields.

However when I try to query the GraphQL API (using the gql explorer while running Gatsby), none of the fields are visible under the content types. To be clear, I can see the content types are there at the top level, but I am not able to see or query any of the fields within them.

The photos below show the fields set up for my “Home” content type in Strapi, and the fields not being present in the GQL explorer.


Is there a step I’m missing to make the fields accessible via the GraphQL API or is this a bug with Strapi v4?

Many Thanks,
Chris

1 Like

I have this exact problem as well. Nothing else for me to add other than I am on Windows and used create-strapi-app. I added one collection type after a fresh install.

What I do find weird is in the schema inspector, I can see the custom collection type there with all of its fields. Unsure why it isn’t working as a query.

Any help would be great!

Thanks to Daedalus on the Discord community (where I shared this thread) the fields can be accessed in “data.attributes”

Query {
 data {
  attributes {
   title
  }
 }
}