@@ -91,14 +91,21 @@ public class AWSGraphQLSubscriptionTaskRunner<R: Decodable>: InternalTaskRunner,
9191 return
9292 }
9393
94- let pluginOptions = request. options. pluginOptions as? AWSAPIPluginDataStoreOptions
94+ let authType : AWSAuthorizationType ?
95+ if let pluginOptions = request. options. pluginOptions as? AWSAPIPluginDataStoreOptions {
96+ authType = pluginOptions. authType
97+ } else if let authorizationMode = request. authMode as? AWSAuthorizationType {
98+ authType = authorizationMode
99+ } else {
100+ authType = nil
101+ }
95102 // Retrieve the subscription connection
96103 do {
97104 self . appSyncClient = try await appSyncClientFactory. getAppSyncRealTimeClient (
98105 for: endpointConfig,
99106 endpoint: endpointConfig. baseURL,
100107 authService: authService,
101- authType: pluginOptions ? . authType,
108+ authType: authType,
102109 apiAuthProviderFactory: apiAuthProviderFactory
103110 )
104111
@@ -262,14 +269,21 @@ final public class AWSGraphQLSubscriptionOperation<R: Decodable>: GraphQLSubscri
262269 return
263270 }
264271
265- let pluginOptions = request. options. pluginOptions as? AWSAPIPluginDataStoreOptions
272+ let authType : AWSAuthorizationType ?
273+ if let pluginOptions = request. options. pluginOptions as? AWSAPIPluginDataStoreOptions {
274+ authType = pluginOptions. authType
275+ } else if let authorizationMode = request. authMode as? AWSAuthorizationType {
276+ authType = authorizationMode
277+ } else {
278+ authType = nil
279+ }
266280 Task {
267281 do {
268282 appSyncRealTimeClient = try await appSyncRealTimeClientFactory. getAppSyncRealTimeClient (
269283 for: endpointConfig,
270284 endpoint: endpointConfig. baseURL,
271285 authService: authService,
272- authType: pluginOptions ? . authType,
286+ authType: authType,
273287 apiAuthProviderFactory: apiAuthProviderFactory
274288 )
275289
0 commit comments