My code is below. What I am trying to do is subscribe to a graphql stream and update the lastMessageTime and lastMessageID after each time I get back messages. I then send those to the server in the stream in order to get new messages only.
I am running into a few issues that lead me to believe that I should not be getting the SubscriptionOptions based off of the state variables and instead somehow be doing this in an invariant way, but that doesn't seem to make sense because how would the server then know what ID and Time to use to return results?
My code is below. What I am trying to do is subscribe to a graphql stream and update the lastMessageTime and lastMessageID after each time I get back messages. I then send those to the server in the stream in order to get new messages only.
I am running into a few issues that lead me to believe that I should not be getting the SubscriptionOptions based off of the state variables and instead somehow be doing this in an invariant way, but that doesn't seem to make sense because how would the server then know what ID and Time to use to return results?
Help?