Using Runtime.runFork for GraphQL Subscription Callbacks

Am i doing these callback correctly with Runtime.runFork? Is there anything more suitable?

This is inside effect.service, some graphql subscriptions

      const updateSubscription = client.models.Users.onUpdate().subscribe({
        next: (payload) => Runtime.runFork(serviceRuntime, handleUserUpdate(payload)),
        error: (error) => Runtime.runFork(serviceRuntime, Effect.logError(error))
      });
Was this page helpful?