3 ms·
One thing I think is a poor design choice on the part of the implementer of this example: Note: Not a design choice of Relay Is that each Mutation file is red
by yazaddaruvala 11y ago
One thing I think is a poor design choice on the part of the implementer of this example:
Note: Not a design choice of Relay
Is that each Mutation file is redundant. Each Mutation file corresponds one - one with a component file. I think it does a big disservice to React itself (specifically JSX), which advocates for collocating View and Template because of cohesion.
Maybe its subjective.. and I can surely see the reasons for separating them, but I hope yungsters is reading this and collocates the mutations.
- underwater 11y agoMutations are global, not view specific. They can be triggered by multiple views, and are smart enough to only refetch the data that is currently being shown. For Facebook we can write a single "like" mutation and share it between comments, posts, photos, etc.