How to filter allMarkdownRemark by folder (Gatsby and GraphQl)
{
resolve: `gatsby-source-filesystem`,
options: {
name: `pages`,
path: `${__dirname}/src/pages/`,
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `posts`,
path: `${__dirname}/src/posts/`,
},
},
Here, the name will not be used; instead, the parent folder will be used.
query MyQuery {
allMarkdownRemark(filter: {fileAbsolutePath: {regex: "/(posts)/" }}) {
nodes {
id
}
}
}

![Troubleshooting [zsh: Corrupt History File]: A Simple Guide for Windows, Linux, macOS](https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/xbEVM6oJ1Fs/upload/160b183e50d491e945ca5ecb02f01896.jpeg)


