I am learning Gatsby.js right now and I ran into a problem. I have installed transformer plugin and I have a .md file in which I have title,stack and slug.
title :Place Sharing Website
stack :React.js & Node.js
slug :place-sharing
---
### You can share the places that you visited
I want to query that title,stack and slug. But I can't do that. Here is the code I tried to do that.
allMarkdownRemark {
nodes {
frontmatter {
title
stack
slug
}
}
}
}
it didn't work.
Here is my gatsby.config file
module.exports = {
plugins: [
"gatsby-transformer-remark",
{
resolve: `gatsby-source-filesystem`,
options: {
name: `notes`,
path: `${__dirname}/src/notes/`,
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `projects`,
path: `${__dirname}/src/projects/`,
},
},
],
siteMetadata: {
title: "My Homepage",
description: "This is where I write my thoughts.",
},
}
Here is how I am trying to query it.
Any idea of what I am doing wrong?
---at the top of the markdown file. Also try going tolocalhost:PORT/__graphqlto see if the markdown file is detected - Akshay