Cannot read query field

I’m relatively new to this.

I set up the project just as described in the tutorials.

I also added .env with API key.

But for some reason I am getting:

error Cannot query field "allDatoCmsProduct" on type "Query"

I did not change anything with the code but it is running fine while deployed on Netlify. However locally it is not running and giving me the query error

Update I am also getting this while trying to build:

“gatsby-source-datocms” threw an error while running the createSchemaCustomization lifecycle:

404 INVALID_ENVIRONMENT (details: {})

ApiException: 404 INVALID_ENVIRONMENT (details: {})

so it seems plugin is not being connected correctly, hence the first error

Hi @nehmetaj and welcome :slight_smile:

Did you integrate DatoCMS in GatsbyJS (I suppose it’s GatsbyJS, tell me if I’m wrong) starting from a blank project and then following this tutorial https://www.datocms.com/docs/gatsby or did you start with one of our examples ( https://www.datocms.com/docs/gatsby/examples ). If the latter option, which example did you choose?