-
Notifications
You must be signed in to change notification settings - Fork 0
/
gatsby-node.js
43 lines (39 loc) · 987 Bytes
/
gatsby-node.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin");
exports.createPages = require("./gatsby/create-pages");
exports.onCreateNode = require("./gatsby/on-create-node");
exports.onCreateWebpackConfig = ({ actions }) => {
actions.setWebpackConfig({
resolve: {
plugins: [new TsconfigPathsPlugin()],
},
});
};
exports.createSchemaCustomization = ({ actions }) => {
const { createTypes } = actions;
const typeDefs = `
type Mdx implements Node @dontInfer {
frontmatter: Frontmatter
fields: Fields
}
type Frontmatter {
title: String
date: Date
tags: [String]
category: String
publish: Boolean
featured: Boolean
socialImage: File @fileByRelativePath
stage: String
}
type Fields {
title: String!
slug: String!
date: Date!
tagSlugs: [String]
categorySlug: String
category: String
stage: String
}
`;
createTypes(typeDefs);
};