Skip to content

Commit 9d20b09

Browse files
morealmeta-codesync[bot]
authored andcommitted
Fix fragment name typo in docs (#5194)
Summary: While reading the Imperatively modifying linked fields (https://relay.dev/docs/guided-tour/updating-data/imperatively-modifying-linked-fields/) docs, I noticed that the fragment is defined as `AssignBestFriendButton_assignable_user` but spread as `AssignableBestFriendButton_assignable_user` throughout the examples. If I understood correctly, Relay's fragment naming convention is `<module_name>_...` (https://relay.dev/docs/guided-tour/rendering/fragments/). Since the component is named `AssignBestFriendButton`, the prefix should be `AssignBestFriendButton` rather than `AssignableBestFriendButton`. Pull Request resolved: #5194 Reviewed By: jean-zhang Differential Revision: D95227085 Pulled By: captbaritone fbshipit-source-id: 6b25cde72641183c0487fa5d6a7ff028261b9b0a
1 parent f9b83af commit 9d20b09

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

website/docs/guided-tour/updating-data/imperatively-modifying-linked-fields.mdx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ graphql`
4949

5050
The fragment must be spread at both the source (i.e. on the viewer's new best friend), and at the destination (within the viewer's `best_friend` field in the updatable query).
5151

52-
Lets define a component with a fragment where we spread `AssignableBestFriendButton_assignable_user`. This user will be the viewer's new best friend.
52+
Lets define a component with a fragment where we spread `AssignBestFriendButton_assignable_user`. This user will be the viewer's new best friend.
5353

5454
```js
5555
// AssignBestFriendButton.react.js
@@ -64,7 +64,7 @@ export default function AssignBestFriendButton({
6464
fragment AssignBestFriendButton_someType on SomeType {
6565
user {
6666
name
67-
...AssignableBestFriendButton_assignable_user
67+
...AssignBestFriendButton_assignable_user
6868
}
6969
}
7070
`, someTypeRef);
@@ -100,7 +100,7 @@ const onClick = () => {
100100
@updatable {
101101
viewer {
102102
best_friend {
103-
...AssignableBestFriendButton_assignable_user
103+
...AssignBestFriendButton_assignable_user
104104
}
105105
}
106106
}
@@ -146,7 +146,7 @@ export default function AssignBestFriendButton({
146146
fragment AssignBestFriendButton_someType on SomeType {
147147
user {
148148
name
149-
...AssignableBestFriendButton_assignable_user
149+
...AssignBestFriendButton_assignable_user
150150
}
151151
}
152152
`, someTypeRef);
@@ -162,7 +162,7 @@ export default function AssignBestFriendButton({
162162
@updatable {
163163
viewer {
164164
best_friend {
165-
...AssignableBestFriendButton_assignable_user
165+
...AssignBestFriendButton_assignable_user
166166
}
167167
}
168168
}
@@ -248,7 +248,7 @@ export default function AssignBestFriendButton({
248248
fragment AssignBestFriendButton_someType on SomeType {
249249
user {
250250
name
251-
...AssignableBestFriendButton_assignable_user
251+
...AssignBestFriendButton_assignable_user
252252
}
253253
}
254254
`, someTypeRef);
@@ -259,7 +259,7 @@ export default function AssignBestFriendButton({
259259
# since viewer.best_friends appears in the right hand side of the assignment
260260
# (i.e. updatableData.viewer.best_friends = viewer.best_friends.concat(...)),
261261
# the best_friends field must contain the correct assignable fragment spread
262-
...AssignableBestFriendButton_assignable_user
262+
...AssignBestFriendButton_assignable_user
263263
}
264264
}
265265
`, viewerRef);
@@ -275,7 +275,7 @@ export default function AssignBestFriendButton({
275275
@updatable {
276276
viewer {
277277
best_friends {
278-
...AssignableBestFriendButton_assignable_user
278+
...AssignBestFriendButton_assignable_user
279279
}
280280
}
281281
}
@@ -309,7 +309,7 @@ const data = useFragment(graphql`
309309
node(id: "4") {
310310
... on User {
311311
__typename
312-
...AssignableBestFriendButton_assignable_user
312+
...AssignBestFriendButton_assignable_user
313313
}
314314
}
315315
}
@@ -326,7 +326,7 @@ const onClick = () => {
326326
@updatable {
327327
viewer {
328328
best_friend {
329-
...AssignableBestFriendButton_assignable_user
329+
...AssignBestFriendButton_assignable_user
330330
}
331331
}
332332
}

0 commit comments

Comments
 (0)