Gatsby: Unknown field `allMarkdownRemark` on type `RootQueryType`

Created on 18 Sep 2017  路  8Comments  路  Source: gatsbyjs/gatsby

This is what I get when following blog creation tutorial:

GraphQL Error Unknown field 'allMarkdownRemark' on type 'RootQueryType'.

Is it possible that this empty index.js is involved? https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-transformer-remark/index.js

Most helpful comment

So I just ran into this issue (or something similar). It seems that if no markdown files are present in your project, then allMarkdownRemark doesn't get added as a query option.

All 8 comments

There should be something wrong with the other parts, for me I need to reinstall gatsby-plugin-sharp every time I installed a new package to make sharp works well on my macbook, or I'll get that error too

Why was this closed - did you resolve it?

So I just ran into this issue (or something similar). It seems that if no markdown files are present in your project, then allMarkdownRemark doesn't get added as a query option.

I had this same issue and finally tracked down the problem. Turned out to be a silly typo but the error messages didn't help me track down the problem.

@tcfunk is right that if you don't have a markdown file the query throws an error. My problem arose because in the repetitive convention of creating new files I added my blog post file as 02-02-2018-first-blog/index.js, note the .js extension. So, renamed to index.md and the problem was solved.

Hopefully, if anyone stumbles on this thread this will solve their problem.

I'm experiencing the issue from the downloaded repo files

GraphQL Error Unknown field `allMarkdownRemark` on type `RootQueryType`

  file: /Users//Dropbox/Blog/gatsby-blog-starter-kit-master/src/pages/index.js

   1 | 
   2 |   query IndexQuery {
>  3 |     allMarkdownRemark(sort: { order: DESC, fields: [frontmatter___date] }) {

node version 9.8.0
yarn version 1.5.1

UPDATE: I think the absolute path is my issue. If I have '(' or ')' in the absolute file path, it breaks the yarn start process. If I place the project in a path without these characters, it builds fine.

I am also having this error, can anyone please help me? I have also named .md files.

--> had similar issue "GraphQL Error Unknown field allMarkdownRemark on type RootQueryType "

  1. Add plugin to config and then:
  2. Install plugin once again to validate gatsby-config.js

Sounds stupid but I did other around and I had this error... Maybe this will help.

Similar to @EMPIR, I had an issue when I had the project in my Dropbox folder. (I think unrelatedly, also had to reinstall sharp). Upon further testing, having the project as a child of a folder with ( and ) in its name seems to cause this error.

I posted more details on #82

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brandonmp picture brandonmp  路  3Comments

3CordGuy picture 3CordGuy  路  3Comments

dustinhorton picture dustinhorton  路  3Comments

magicly picture magicly  路  3Comments

totsteps picture totsteps  路  3Comments