Remove an `invariant` check from `RelayConcreteVariables`
@@ -40,13 +40,14 @@ function getFragmentVariables(
variables[definition.name] = definition.defaultValue;
break;
case 'RootArgument':
- invariant(
- rootVariables.hasOwnProperty(definition.name),
- 'RelayConcreteVariables: Expected a defined query variable for `$%s` ' +
- 'in fragment `%s`.',
- definition.name,
- fragment.name,
- );
+ if (!rootVariables.hasOwnProperty(definition.name)) {
+ /*
+ * A temporary fix to mute false alarm in cases where the root argument is stripped
+ * off by the compiler due to a conditional directive, we do not need this argument
+ * when tryiny to read the data from the store.
+ */
+ break;
+ }
variables[definition.name] = rootVariables[definition.name];
break;
default:
