Skip to content

Update Blog page allMdx query

Compare
Choose a tag to compare
@theianjones theianjones released this 10 Sep 15:47
· 9 commits to master since this release
fbd1ec6

This adds isPost to any mdx node:

// gatsby-node.js
createNodeField({
      name: 'isPost',
      node,
      value: true,
    })

Update the page query in src/templates/blog.js

//...
allMdx(
      sort: { fields: [frontmatter___date], order: DESC }
      filter: { fields: { isPost: { eq: true } } }
    )
//...

This allows us to remove:

parent {	
    ... on File {	
     sourceInstanceName	
    }	
}