1
1
mirror of https://github.com/jxnblk/mdx-deck.git synced 2024-10-26 07:37:23 +03:00

Adjust resolvers in gatsby theme

This commit is contained in:
Brent Jackson 2020-01-31 13:00:00 -05:00
parent ba5485f114
commit a1fcaa6ad5
3 changed files with 1955 additions and 1893 deletions

View File

@ -4,3 +4,4 @@
---
## Boop bop

View File

@ -49,9 +49,8 @@ const resolveTitle = async (...args) => {
return first.value || ''
}
exports.sourceNodes = ({ actions, schema }) => {
const { createTypes } = actions
createTypes(
exports.createSchemaCustomization = ({ actions, schema }) => {
actions.createTypes(
schema.buildObjectType({
name: `Deck`,
fields: {
@ -60,7 +59,7 @@ exports.sourceNodes = ({ actions, schema }) => {
type: `String!`,
},
title: {
type: `String!`,
type: 'String!',
resolve: resolveTitle,
},
body: {
@ -180,11 +179,12 @@ exports.onCreateNode = ({
if (node.internal.type !== `Mdx` || source !== contentPath) return
const slug = toPath(fileNode)
const id = createNodeId(`${node.id} >>> Deck`)
createNode({
slug,
// Required fields.
id: createNodeId(`${node.id} >>> Deck`),
id,
parent: node.id,
children: [],
internal: {
@ -194,7 +194,7 @@ exports.onCreateNode = ({
description: `Slide Decks`,
},
})
createParentChildLink({ parent: fileNode, child: node })
createParentChildLink({ parent: fileNode, child: getNode(id) })
}
exports.onCreateDevServer = ({ app }) => {

3835
yarn.lock

File diff suppressed because it is too large Load Diff