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] fix markdown issue in fragments.md #3408

Closed
wants to merge 2 commits into from
Closed

[docs] fix markdown issue in fragments.md #3408

wants to merge 2 commits into from

Conversation

lucasweng
Copy link
Contributor

@lucasweng lucasweng commented Mar 14, 2021

Currently, this doesn't render right:

Screen Shot 2021-03-14 at 11 09 51 AM

The change:

The generated Flow types include a type for the fragment reference, which is the type with the $key suffix: <fragment_name>$key, and a type for the shape of the data, which is the type with the $data suffix: <fragment_name>$data; these types are available to import from files that are generated with the following name: <fragment_name>.graphql.js

@@ -85,7 +85,7 @@ Let's distill what's going on here:
* A *fragment reference* is an object that Relay uses to *read* the data declared in the fragment definition; as you can see, the `UserComponent_user` fragment itself just declares fields on the `User` type, but we need to know *which* specific user to read those fields from; this is what the fragment reference corresponds to. In other words, a fragment reference ** is like *a pointer to a specific instance of a type* that we want to read data from.
* Note that *the component is automatically subscribed to updates to the fragment data*: if the data for this particular `User` is updated anywhere in the app (e.g. via fetching new data, or mutating existing data), the component will automatically re-render with the latest updated data.
* Relay ** will automatically generate Flow types for any declared fragments when the compiler is run, so you can use these types to declare the type for your Component's `props`.
* The generated Flow types include a type for the fragment reference, which is the type with the `$key` suffix: ``*<fragment_name>*``$key``, and a type for the shape of the data, which is the type with the `$data` suffix: ``*<fragment_name>*``$data``; these types are available to import from files that are generated with the following name: `*<fragment_name>*.graphql.js`.
* The generated Flow types include a type for the fragment reference, which is the type with the `$key` suffix: `*<fragment_name>*$key`, and a type for the shape of the data, which is the type with the `$data` suffix: `*<fragment_name>*$data`; these types are available to import from files that are generated with the following name: `*<fragment_name>*.graphql.js`.
Copy link
Member

Choose a reason for hiding this comment

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

You can generally drop these *s within the backticks: they're a formatting quirk from our internal doc tool which used to allow us to bold/italicize code blocks. We can just drop them here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it. I'll remove those *s and **s. Thought the *<>* was some sort of syntax highlight. 😅

@@ -85,7 +85,7 @@ Let's distill what's going on here:
* A *fragment reference* is an object that Relay uses to *read* the data declared in the fragment definition; as you can see, the `UserComponent_user` fragment itself just declares fields on the `User` type, but we need to know *which* specific user to read those fields from; this is what the fragment reference corresponds to. In other words, a fragment reference ** is like *a pointer to a specific instance of a type* that we want to read data from.
Copy link
Member

Choose a reason for hiding this comment

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

Do you mind removing these stray **s too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing that out. All *s and **s are dropped! 8b21be8

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@poteto has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Member

@poteto poteto left a comment

Choose a reason for hiding this comment

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

Thanks @lucasweng, LGTM!

@facebook-github-bot
Copy link
Contributor

@poteto merged this pull request in 134b6c9.

@lucasweng lucasweng deleted the docs-1 branch March 17, 2021 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants