facebook / facebook/relay

[Modern] Poor error message for arrays without plural directive

Open
#2,152 1 comment 0 reactions 0 assignees View on GitHub
wontfix
Dominant language
Rust
Stars
19k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

The error message supplied when forgetting to add a plural directive is terrible:

> Error: Attempted to update component `Relay(Songs)` that has already been unmounted (or failed to mount).

incorrect:

```
import Songs from './component';

export const query = graphql`
query songsContainerQuery {
songs {
...songsContainer_songs
}
}
`;

export default createFragmentContainer(Songs, graphql`
fragment songsContainer_songs on Song {
name
}`,
);
```

correct:

```
graphql`
fragment songsContainer_songs on Song @relay(plural: true) {
name
}`
```

Relay modern should give a better error message when forgetting this.

More information: https://stackoverflow.com/questions/46757227/relay-modern-attempted-to-update-component-relaysongs-that-has-already-been/46759043#46759043

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.