-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Conversation
@@ -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`. |
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.
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.
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.
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. |
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.
Do you mind removing these stray **
s 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.
Thanks for pointing that out. All *
s and **
s are dropped! 8b21be8
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.
@poteto has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
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.
Thanks @lucasweng, LGTM!
Currently, this doesn't render right:
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