Apollo query subscription doesn't have extensions part in Error

13 Views Asked by At

subscription callback only provides a basic error message and lacks additional details such as error code and type, while the network tab displays a properly structured errors array, it suggests that the subscription isn't transmitting the complete error object

I tried several changes

1

There are 1 best solutions below

1
Farwa MIraj On BEST ANSWER
Add errorPolicy: 'all' in your query it will resolve your issue and will provide proper error like this:
[result][1]

    this.apollo.watchQuery({
      query: GET_DATA,
      **errorPolicy: 'all',** // Set the desired error policy here
    })
   .subscribe({ //and handle this subscription part according to your version
      next: (result) => {
        // Handle successful response
      },
      error: (error) => {
        // Handle error
      }
    });

  [1]: https://i.stack.imgur.com/RTqZ0.png