我正在使用gatsby-plugin-mdx创建页面。但我希望基于gatsby-source-filesystem创建不同类型的页面。我在gatsby-source-filesystem配置中使用了不同的名称,但似乎无法将其传递给mdx节点。有谁知道这样做的方法吗?
发布于 2019-11-19 14:31:04
不要直接查询allMdx。而是使用sourceInstanceName字段的筛选器来查询allFile。
{
allFile(filter: { sourceInstanceName: { eq: "products" } }) {
childMdx { ... }
}
}https://stackoverflow.com/questions/58926899
复制相似问题