Gracefully handle when data is not available

This commit is contained in:
Chi Vinh Le
2017-08-18 21:19:13 +07:00
parent 00f365ab38
commit de90bdbd19
+3 -1
View File
@@ -30,7 +30,9 @@ function filterProps(props, fragments) {
if (!(key in props)) {
return;
}
filtered[key] = filter(fragments[key], props[key], props.data.variables);
filtered[key] = props.data
? filter(fragments[key], props[key], props.data.variables)
: props[key];
});
return filtered;
}