diff --git a/AmplifyPlugins/API/Sources/AWSAPIPlugin/Operation/AWSGraphQLSubscriptionTaskRunner.swift b/AmplifyPlugins/API/Sources/AWSAPIPlugin/Operation/AWSGraphQLSubscriptionTaskRunner.swift index 3f3889566a..13cba6b888 100644 --- a/AmplifyPlugins/API/Sources/AWSAPIPlugin/Operation/AWSGraphQLSubscriptionTaskRunner.swift +++ b/AmplifyPlugins/API/Sources/AWSAPIPlugin/Operation/AWSGraphQLSubscriptionTaskRunner.swift @@ -46,10 +46,7 @@ public class AWSGraphQLSubscriptionTaskRunner: InternalTaskRunner, public func cancel() { self.send(GraphQLSubscriptionEvent.connection(.disconnected)) - Task { [weak self] in - guard let self else { - return - } + Task { guard let appSyncClient = self.appSyncClient else { return }