-
In the example, PokemonItem gets data of type FragmentOf, and then we need to read the fragment:
Wouldn't it be better to pass the result and read a fragment in the parent component, something like this:
PokemonList.tsx:
Is it just a matter of taste or there are some benefits to passing FragmentOf to the child component? What do you think? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is all explained on our docs page on Fragment Colocation: https://gql-tada.0no.co/guides/fragment-colocation/ The first thing of note is, you can unmask fragments. Then the parent document that spreads the fragment will see its full selection type as well. With masked fragments however, the entire point is that:
The purpose of this is isolation and enforcing good data dependency practices |
Beta Was this translation helpful? Give feedback.
This is all explained on our docs page on Fragment Colocation: https://gql-tada.0no.co/guides/fragment-colocation/
The first thing of note is, you can unmask fragments. Then the parent document that spreads the fragment will see its full selection type as well.
With masked fragments however, the entire point is that:
The purpose of this is isolation and enforcing good data dependency practices