Created
September 9, 2017 20:27
-
-
Save DSchau/86ee9288b05d236dada81148f66db8db to your computer and use it in GitHub Desktop.
The GraphQL query showing how to format a date!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const pageQuery = graphql` | |
query IndexQuery { | |
site { | |
siteMetadata { | |
title | |
author | |
} | |
} | |
allMarkdownRemark(sort: { order: DESC, fields: [frontmatter___date] }) { | |
edges { | |
node { | |
excerpt(pruneLength: 250) | |
id | |
frontmatter { | |
date(formatString: "MMMM DD, YYYY") | |
draft | |
excerpt | |
path | |
tags | |
title | |
} | |
} | |
} | |
} | |
} | |
` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for this!!