https://github.com/facebook/relay/releases/tag/v10.0.0
Precise type refinement: gated by RelayFeatureFlags.ENABLE_PRECISE_TYPE_REFINEMENT. With this feature enabled Relay more accurately models GraphQL semantics around inline fragments and fragment spreads which have a different type than their parent selection. This helps Relay to more accurately determine if a query can be fulfilled from the cache (ie with the âstore-or-networkâ fetch policy) and also more accurately determine if data is missing and that a component should suspend. Generally speaking, the change is observable as fewer false positives where Relay thinks data is âmissingâ when it isnât. This feature will be enabled by default in a subsequent release; we recommend enabling it now.
How do I enable the suggested feature flag? I am unable to locate any official documented reference to RelayFeatureFlags.
require('relay-runtime).RelayFeatureFlags.ENABLE_PRECISE_TYPE_REFINEMENT = true
in your app entrypoint
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@sibelius Any ideas on how to enable them for relay-compiler?
You could use patch package, or modify the flag and call the compiler directly in another cli
You gotta add
require('relay-runtime').RelayFeatureFlags.ENABLE_VARIABLE_CONNECTION_KEY = true
to node_modules/relay-compiler/bin/relay-compiler.
as @sibelius mentioned, patch-package is the right tool for this!
Most helpful comment
require('relay-runtime).RelayFeatureFlags.ENABLE_PRECISE_TYPE_REFINEMENT = truein your app entrypoint