Skip to content

Commit

Permalink
Create GraphQL schema for blog Frontmatter.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgaehring committed Jul 1, 2022
1 parent 80647e8 commit a9f544e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,21 @@ exports.createPages = async ({ graphql, actions }) => {
});
});
};

exports.createSchemaCustomization = ({ actions }) => {
const { createTypes } = actions
const typeDefs = `
type MarkdownRemark implements Node {
frontmatter: Frontmatter
}
type Frontmatter {
author: String
canonical: String
# Date is the only required (non-nullable) field.
date: Date! @dateformat
slug: String
title: String
}
`
createTypes(typeDefs)
}

0 comments on commit a9f544e

Please sign in to comment.