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:
parent
ba5485f114
commit
a1fcaa6ad5
@ -4,3 +4,4 @@
|
||||
---
|
||||
|
||||
## Boop bop
|
||||
|
||||
|
@ -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 }) => {
|
||||
|
Loading…
Reference in New Issue
Block a user