Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(
config: AutoRelayConfigArgs
) {
if (!config) throw new Error(`No config supplied to AutoRelay`)
Container.remove(PAGINATION_OBJECT, CONNECTIONARGS_OBJECT)
this._registerOrm(config)
if ((config as AutoRelayConfigArgsExistingModel).objects) {
this._declareExistingObjects(config as AutoRelayConfigArgsExistingModel)
} else {
const configNoModel: AutoRelayConfigArgsNoModel = config;
configNoModel.microserviceName = configNoModel.microserviceName ? String(configNoModel.microserviceName) : ''
if ( configNoModel.microserviceName) {
configNoModel.microserviceName = configNoModel.microserviceName![0].toUpperCase() + configNoModel.microserviceName!.substring(1)
}
AutoRelayConfig.generateObjects(config, true)
Container.set(PREFIX, configNoModel.microserviceName)
if (configNoModel.extends && configNoModel.extends.connection) {