Reputation: 383
I'm using gatsby-plugin-mdx to create pages. But I want to create different kinds of pages based on the folder they are sourced from with gatsby-source-filesystem. I made the name different in the gatsby-source-filesystem config but I can't seem to pass that along to the mdx node. Does anyone know of a way to do this?
Upvotes: 1
Views: 786
Reputation: 4820
Don't query allMdx
directly. Instead do query for allFile
using a filter for sourceInstanceName
field.
{
allFile(filter: { sourceInstanceName: { eq: "products" } }) {
childMdx { ... }
}
}
Upvotes: 6