Skip to content

useSubscription does not conform to Apollo #759

@objectiveSee

Description

@objectiveSee

The useSubscription hook using the AppSync link does not work correctly. Specifically, it does not implement the onComplete event which is defined by Apollo documentation. You can reproduce this by simply adding an onComplete handler to any subscription. This is important because there is no other way know when the subscription has been established. It would be nice to send this event.

I can try to make these changes if somebody could point me in the correct direction in the codebase.

Example:


  const { data, loading, error } = useSubscription<TData, TVariables>(
    subscription,
    {
      variables,
      onError,
      onComplete: () => {
        console.log('😵😵😵😵😵😵😵😵😵'); // <---- this never gets called :/ 
      }
    }
  );

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions