-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(gatsby-transformer-documentationjs): Add childOf, mimeTypes and fill in other schema typings #25113
fix(gatsby-transformer-documentationjs): Add childOf, mimeTypes and fill in other schema typings #25113
Conversation
@@ -45,7 +45,7 @@ function prepareDescriptionNode(node, markdownStr, name, helpers) { | |||
exports.sourceNodes = ({ actions }) => { | |||
const { createTypes } = actions | |||
const typeDefs = /* GraphQL */ ` | |||
type DocumentationJs implements Node { | |||
type DocumentationJs implements Node @childOf(types: ["File", "DocumentationJs"]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would anything break if we specify that the file is a child of itself? (each DocumentationJs
node has child nodes)
Also should we add a mimeTypes: ["application/javascript"]
here too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've run a quick test and specifying childOf
of self doesn't seem to break anything. As for mimeTypes
- this should also work but I don't have enough context on this plugin to say if it makes sense here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
…ill in other schema typings (gatsbyjs#25113) * Add mimeTypes and other directives to fill in files * add placeholder type
Description
@childOf
directive toDocumentationJs
type to verify it's a descendant of File nodes.type DocumentationJSComponentDescription
and add a@mimeTypes
to specify it's a Markdown node.Related
#25112