Should we use ResultOf on fragment documents? #309
-
Let's say I just want to use a certain type in helper function but not in component. Here is a fragment doc:
One way I can get the type without using Other one is using So, are these both approaches the same and should we use it like this way? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
There's more information here: https://gql-tada.0no.co/guides/fragment-colocation#fragment-colocation-1 Whether you're using |
Beta Was this translation helpful? Give feedback.
There's more information here: https://gql-tada.0no.co/guides/fragment-colocation#fragment-colocation-1
Whether you're using
@_unmask
or not, theFragmentOf
utility type will continue to work and give you the correct type. You can useResultOf
on an unmasked fragment, but if you ever remove@_unmask
, it'll stop working, whereasreadFragment
andFragmentOf
are designed to work whether the fragment is unmasked or not, to allow you to change your mind later on.