"message": "Cannot query field \"allMarkdownRemark\" on type \"RootQueryType\".",
query
{
allMarkdownRemark {
edges {
node {
title
}
}
}
package.json
{
"name": "gatsby-starter-hello-world",
"description": "Gatsby hello world starter",
"license": "MIT",
"scripts": {
"develop": "gatsby develop",
"build": "gatsby build",
"serve": "gatsby serve"
},
"dependencies": {
"gatsby": "^1.9.119",
"gatsby-link": "^1.6.28",
"gatsby-plugin-styled-components": "^2.0.3",
"gatsby-plugin-typography": "^1.7.10",
"gatsby-remark-copy-linked-files": "^1.5.22",
"gatsby-source-filesystem": "^1.5.9",
"gatsby-transformer-json": "^1.0.13",
"gatsby-transformer-remark": "^1.7.23",
"styled-components": "^2.2.4",
"typography": "^0.16.6",
"typography-theme-bootstrap": "^0.16.7",
"typography-theme-lawton": "^0.15.10",
"typography-theme-us-web-design-standards": "^0.16.9"
}
}
http://localhost:8000/___graphql?query=%7B%0A%20%20allMarkdownRemark%20%7B%0A%20%20%20%20edges%20%7B%0A%20%20%20%20%20%20node%20%7B%0A%09%09%09title%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D
I also cannot query JSON file or markdown files as I expect.
I have json file in /data/a.json with { 'value': 'a' }
I have rm -rf node_modules/ and reinstalled.
I have used two browsers just in case of cache issue.
gatsby-config.js
`
module.exports = {
siteMetadata: {
title: `ARWD`,
},
plugins: [
`gatsby-transformer-json`,
`gatsby-transformer-remark`,
`gatsby-plugin-styled-components`,
`gatsby-plugin-typography`,
{
resolve: `gatsby-plugin-typography`,
options: {
pathToConfigModule: `src/utils/typography.js`,
}
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `CMECF`,
path: `${__dirname}/public/files/CMECF`,
}
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `Attorney`,
path: `${__dirname}/public/files/Attorney`,
}
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `Applications`,
path: `${__dirname}/public/files/Applications`,
}
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `Files`,
path: `${__dirname}/public/files`,
}
},
],
}
`
Possibly related to #2212
I'm getting the same error:
GraphQLError: Cannot query field "allMarkdownRemark" on type "RootQueryType"
the thing is I have two gatsby sites. they are forks of the same root project. One works fine and builds without a problem. the other throws that error. they are structured similarly.
I even cp'd the node_modules folder directly from working to non working project, in case it was a version problem.
Does the site with the error have any markdown files?
The error @jonathan-chin is seeing is probably #3103 in conjunction with #2212.
If the @thebetterjort's repo includes markdown files, it may also be consequent to #3103.
The repo does include markdown files. #3103 seems related. It's working after I recreated the config.
@thebetterjort Is this now working for you with the latest version of Gatsby?
I'm still getting this error!
My package.json
{
"name": "gatsby-starter-default",
"description": "Gatsby default starter",
"version": "1.0.0",
"author": "Kyle Mathews <[email protected]>",
"dependencies": {
"gatsby": "^1.9.247",
"gatsby-link": "^1.6.40",
"gatsby-plugin-catch-links": "^1.0.22",
"gatsby-plugin-react-helmet": "^2.0.11",
"gatsby-source-filesystem": "^1.5.36",
"gatsby-transformer-remark": "^1.7.41",
"react-helmet": "^5.2.0",
"react-media": "^1.8.0"
},
"keywords": [
"gatsby"
],
"license": "MIT",
"scripts": {
"build": "gatsby build",
"develop": "gatsby develop",
"format": "prettier --write 'src/**/*.js'",
"test": "echo \"Error: no test specified\" && exit 1"
},
"devDependencies": {
"prettier": "^1.12.0"
}
}
My gatsby-config.js
module.exports = {
siteMetadata: {
title: 'Gatsby Default Starter',
},
plugins: [
'gatsby-plugin-react-helmet',
'gatsby-plugin-catch-links',
{
resolve: 'gatsby-source-filesystem',
options: {
path: `${__dirname}/src/pages`,
name: 'pages',
}
},
'gatsby-transformer-remark'
],
}
I do have an md file
Graphql query for blog-post.js
export const pageQuery = graphql (
query BlogPostByPath($path: String!) {
markdownRemark(frontmatter: { path: { eq: $path } }) {
html
frontmatter {
date(formatString: "MMMM DD, YYYY")
path
title
}
}
}
);
@droidMakk Can you share repository so we could reproduce the problem? There is not enough context in stuff you posted to figure out what's wrong
@pieh
https://github.com/droidmakk/droidblog
For some reason the url is looking broken.
Though try searching for droidmakk/droidblog. That's where you'll find it!
Thanks, for the help.
Hey @droidMakk 👋
Using Node v9.6.1 I did a fresh clone of your repository, checked out the master branch, ran yarn, then ran yarn develop and saw no errors – things appear to have been working fine
More information on your environment and the commands you're running could be useful, but you might also try doing a fresh clone of the project like I did to see if that sorts things out
Hey @flipactual @pieh . Thanks for the help been migrating my work folders from one user to the other to test if the path was the problem. Turns out actually that was the problem.
Thanks again for the help guys!
Glad to hear it's working @droidMakk!
Per this conversation and https://github.com/gatsbyjs/gatsby/issues/3150#issuecomment-369728439 I'm going to close the issue, but feel free to reopen or a create a new issue if the problem pops back up again
Using plugin gatsby-source-filesystem add also path to your folder with .md files.
My code had been working, but a recent upgrade to around 2.18 seems to have broken the gatsby-tinacms-remark plugin.
Most helpful comment
Using plugin gatsby-source-filesystem add also path to your folder with .md files.