Skip to content
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

Merged

Conversation

tesseralis
Copy link
Contributor

Description

  • Add @childOf directive to DocumentationJs type to verify it's a descendant of File nodes.
  • Add type DocumentationJSComponentDescription and add a @mimeTypes to specify it's a Markdown node.

Related

#25112

@tesseralis tesseralis requested a review from a team as a code owner June 19, 2020 01:56
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jun 19, 2020
@@ -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"]) {
Copy link
Contributor Author

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?

Copy link
Contributor

@vladar vladar Jun 26, 2020

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.

@smthomas smthomas added topic: transformers and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jun 19, 2020
Copy link
Contributor

@vladar vladar left a 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!

@tesseralis tesseralis merged commit 48f7878 into master Jun 27, 2020
@delete-merged-branch delete-merged-branch bot deleted the gatsby-transformer-documentationjs/schema-improvements branch June 27, 2020 00:41
pragmaticpat pushed a commit to pragmaticpat/gatsby that referenced this pull request Apr 28, 2022
…ill in other schema typings (gatsbyjs#25113)

* Add mimeTypes and other directives to fill in files

* add placeholder type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants