diff --git a/Jobs/GraphQL/GraphQLJob.vb b/Jobs/GraphQL/GraphQLJob.vb index f9666725..be5abc56 100644 --- a/Jobs/GraphQL/GraphQLJob.vb +++ b/Jobs/GraphQL/GraphQLJob.vb @@ -24,12 +24,20 @@ Public Class GraphQLJob Public Sub Start(Args As GraphQLArgs) Implements IJob(Of GraphQLArgs).Start Try Dim oConfigPath As String = Args.QueryConfigPath - Dim oConfigManager As New ConfigManager(Of GraphQLConfig)(_LogConfig, oConfigPath) + ' ConfigManager is missing, so we manually load the config + Dim oConfig As GraphQLConfig = Nothing + If File.Exists(oConfigPath) Then + ' Simple deserialization from JSON, assuming config is stored as JSON + Dim json As String = File.ReadAllText(oConfigPath) + oConfig = System.Text.Json.JsonSerializer.Deserialize(Of GraphQLConfig)(json) + Else + Throw New FileNotFoundException($"Config file not found: {oConfigPath}") + End If - With oConfigManager.Config + With oConfig _GraphQL = New GraphQLInterface(_LogConfig, .BaseUrl, .Email, .Password, .CertificateFingerprint) End With - _Logger.Info($"baseUrl is: {oConfigManager.Config.BaseUrl}") + _Logger.Info($"baseUrl is: {oConfig.BaseUrl}") _Model = New GraphQLModel(_LogConfig, _MSSQL) _Writer = New GraphQLWriter(_LogConfig, _MSSQL)