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

docs: Link mapping to @link #16152

Merged
merged 2 commits into from
Aug 5, 2019
Merged

Conversation

stefanprobst
Copy link
Contributor

Link to creating foreign-key relations with the @link directive from mappings, and vice versa.

Fixes: #15816
Related: #16118, #15920

@stefanprobst stefanprobst added the type: documentation An issue or pull request for improving or updating Gatsby's documentation label Jul 27, 2019
@stefanprobst stefanprobst requested a review from a team as a code owner July 27, 2019 12:19
Copy link
Contributor

@m-allanson m-allanson 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! One question on the Note: section

@@ -319,6 +319,10 @@ Gatsby's automatic type inference has one trick up its sleeve: for every field
that ends in `___NODE` it will interpret the field value as an `id` and create a
foreign-key relation.

> Note: Before the introduction of the Schema Customization APIs in Gatsby v2.2,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unsure what the takeaway is here - as a reader should this inform me that using mappings or ___NODE are equivalent, and that in both cases I can now use schema customisation instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes -- previously a plugin author would use the ___NODE naming convention to create links between nodes when creating the nodes (i.e. used by source/transformer plugins), and a user would use the mappings config key. both users and plugin authors can now use the @link extension.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's great - I added one more line at the end that matches your comment here

freiksenet
freiksenet previously approved these changes Aug 5, 2019
Copy link
Contributor

@freiksenet freiksenet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, if @m-allanson is ok we can merge.

Copy link
Contributor

@m-allanson m-allanson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

@m-allanson m-allanson added the bot: merge on green Gatsbot will merge these PRs automatically when all tests passes label Aug 5, 2019
@gatsbybot gatsbybot merged commit 2aa002b into gatsbyjs:master Aug 5, 2019
@stefanprobst stefanprobst deleted the docs-mapping-link branch August 5, 2019 09:02
lipis added a commit to lipis/gatsby that referenced this pull request Aug 5, 2019
* 'master' of github.com:gatsbyjs/gatsby: (103 commits)
  chore(showcase): add AntdSite (gatsbyjs#16376)
  docs: Fix typos in docs/blog (gatsbyjs#16366)
  chore(starters): add gatsby-starter-fashion-portfolio (gatsbyjs#16333)
  chore(showcase): Add Fourpost (gatsbyjs#16390)
  Docs: Fix a markdown syntax error in recipes.md (gatsbyjs#16371)
  docs: Update building-a-theme.md (gatsbyjs#16364)
  fix: update dependency @theme-ui/prism to ^0.2.29 (gatsbyjs#16385)
  chore: update dependency gatsby to ^2.13.51 (gatsbyjs#16375)
  Fix www build
  fix: update dependency @theme-ui/typography to ^0.2.29 (gatsbyjs#16386)
  fix: update dependency gatsby-plugin-theme-ui to ^0.2.29 (gatsbyjs#16387)
  fix: update dependency theme-ui to ^0.2.29 (gatsbyjs#16388)
  fix(www): fallback to github & unpkg to get README.md (gatsbyjs#16322)
  fix(www): replace \n into newlines for guess (gatsbyjs#16382)
  fix(gatsby): always use publicLoader for window.___loader (gatsbyjs#16122)
  feat(docs): Document what breaking changes are for themes (gatsbyjs#16302)
  docs: Link mapping to @link (gatsbyjs#16152)
  fix(gatsby): Add findMatchPath to the default loader (gatsbyjs#16334)
  feat(gatsby): Allow custom resolver context (gatsbyjs#16359)
  feat(docs): Add docs for @nodeInterface extension (gatsbyjs#16356)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: merge on green Gatsbot will merge these PRs automatically when all tests passes type: documentation An issue or pull request for improving or updating Gatsby's documentation
4 participants