-
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
docs: fix the lost of external file node after rebuilding #22528
Conversation
…lding After adding this, someone can modify `*.md`, then the rebuilding by 'gatsby develop' will not break the type inference for a foreign-key field created by the plugin. Fix(gatsbyjs#22127): gatsbyjs#22127
Thanks for the PR! This is a really great change. Looking at the larger doc I'm thinking we should also make an update to item 1 in the going step by step through the code section. Namely,
Would that have helped you when you ran into the problem? Open to suggestions. |
How about this change for item 1: Define some types for MarkdownRemark using the Schema Customization API. For |
That looks great! |
@@ -85,7 +85,7 @@ exports.onCreateNode = async ({ | |||
|
|||
Going step by step through the code: | |||
|
|||
1. Define some types for `MarkdownRemark` using the Schema Customization API. Defining a field for alternative text as `featuredImgAlt` can also improve accessibility, in addition to providing context for the image if it fails to load. | |||
1. Define some types for MarkdownRemark using the Schema Customization API. For `featuredImg`, use the `from` argument to point the `link` extension to the correct field name(with a `___NODE` suffix), [more details about foreign-key fields here](https://www.gatsbyjs.org/docs/schema-customization/#foreign-key-fields). Defining a field for alternative text as `featuredImgAlt` can also improve accessibility, in addition to providing context for the image if it fails to load. |
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.
1. Define some types for MarkdownRemark using the Schema Customization API. For `featuredImg`, use the `from` argument to point the `link` extension to the correct field name(with a `___NODE` suffix), [more details about foreign-key fields here](https://www.gatsbyjs.org/docs/schema-customization/#foreign-key-fields). Defining a field for alternative text as `featuredImgAlt` can also improve accessibility, in addition to providing context for the image if it fails to load. | |
1. Define some types for MarkdownRemark using the Schema Customization API. For `featuredImg`, use the `from` argument to point the `link` extension to the correct field name (with a `___NODE` suffix), [more details about foreign-key fields here](https://www.gatsbyjs.org/docs/schema-customization/#foreign-key-fields). Defining a field for alternative text as `featuredImgAlt` can also improve accessibility, in addition to providing context for the image if it fails to load. |
This is great! Thanks so much for tracking down the solution elsewhere in the docs and making this change to help future users :) |
That is so kind of you. Thank you. It's a snap to me. I'll be happy if it can really help anyone else. |
Holy buckets, @StinsonZhao — we just merged your PR to Gatsby! 💪💜 Gatsby is built by awesome people like you. Let us say “thanks” in two ways:
If there’s anything we can do to help, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’. Thanks again! |
Description
After adding this, someone can modify
*.md
, then the rebuilding by 'gatsby develop' will not break the type inference for a foreign-key field created by the plugin.Related Issues
Fix #22127