Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (badSchema) {
console.error('Bad schema. Types that share unions/interfaces have fields of the same name but different types. This is not allowed\n',
'fortune type', fortuneName, '\n',
'field name', fieldName, '\n',
'currType', fortuneConfigForName[fieldName], '\n',
'newType', fields[fieldName]);
}
}
});
fortuneConfig[fortuneName] = fortuneConfigForName;
}
});
const store = fortune(fortuneConfig, this.fortuneOptions);
window['store'] = store;
return store;
}
if (badSchema) {
console.error('Bad schema. Types that share unions/interfaces have fields of the same name but different types. This is not allowed\n',
'fortune type', fortuneName, '\n',
'field name', fieldName, '\n',
'currType', fortuneConfigForName[fieldName], '\n',
'newType', fields[fieldName]);
}
}
});
fortuneConfig[fortuneName] = fortuneConfigForName;
}
});
const store = fortune(fortuneConfig, this.fortuneOptions);
window['store'] = store;
return store;
}
const newType = fields[fieldName];
if (!currType) {
fortuneConfigForName[fieldName] = newType;
}
else {
let badSchema = typeof newType !== typeof currType;
badSchema = badSchema ? badSchema : !isEqual(fortuneConfigForName[fieldName], fields[fieldName]);
if (badSchema) {
console.error('Bad schema. Types that share unions/interfaces have fields of the same name but different types. This is not allowed\n', 'fortune type', fortuneName, '\n', 'field name', fieldName, '\n', 'currType', fortuneConfigForName[fieldName], '\n', 'newType', fields[fieldName]);
}
}
});
fortuneConfig[fortuneName] = fortuneConfigForName;
}
});
const store = fortune(fortuneConfig, this.fortuneOptions);
window['store'] = store;
return store;
};
this.generateOptions = (options, graphQLTypeName, ids) => {