website/docs/api-reference/graphql/graphql-directives.md: Incorrect variable use under useFragment example?
Open
- Dominant language
- Rust
- Stars
- 19k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
The current code is:
https://github.com/facebook/relay/blame/f4345cb5ef8d771170649b6c01b29ce530dcde0f/website/docs/api-reference/graphql/graphql-directives.md#L174-L192
However, `item` is expected to be of type `$key`, carrying no actual object data. The data fetched from the cache is exposed to the local `data` variable.
So, this example should be either using `data.title` instead of `item.title` (and also `processItemData(data)` instead of `processItemData(item)`; or, have the input renamed to `itemRef`, and the local var to `item`, leaving the data access calls.
Contributor guide
Assessment
This issue has not been assessed yet.