Below, you will find an example of the code I am currently using to submit data to a server and the resulting response that is received and saved:
this.apollo.mutate( { mutation: XXXXXXXX, variables: { instance_string: X,
accesstoken: X } })
.subscribe({
next: (data: any ) => {
console.log("data returned from Server", data);
// This data can be sent from the Server in a loop on occasion
this.SaveData(data);
},
error: (err) => {
this.presentToastFail(err);
}
});
At times, the Server may return the data in a continuous loop. Since I have no control over the Server's behavior and it seems like this issue will persist for some time, is there a method to ensure that the 'next' function only executes once and disregards any subsequent loops of data returns from the Server?