Merge pull request #19523 from gustavotrott/middleware-stop-retransmitting-mutations
Prevent graphql-middlware from re-transmitting Mutations
This commit is contained in:
commit
ecace2f221
@ -96,20 +96,23 @@ RangeLoop:
|
||||
jsonPatchSupported = true
|
||||
}
|
||||
|
||||
browserConnection.ActiveSubscriptionsMutex.Lock()
|
||||
browserConnection.ActiveSubscriptions[queryId] = common.GraphQlSubscription{
|
||||
Id: queryId,
|
||||
Message: fromBrowserMessageAsMap,
|
||||
OperationName: operationName,
|
||||
StreamCursorField: streamCursorField,
|
||||
StreamCursorVariableName: streamCursorVariableName,
|
||||
StreamCursorCurrValue: streamCursorInitialValue,
|
||||
LastSeenOnHasuraConnetion: hc.Id,
|
||||
JsonPatchSupported: jsonPatchSupported,
|
||||
Type: messageType,
|
||||
//Not storing Mutations because they will not be retransmitted in case of reconnection
|
||||
if messageType != common.Mutation {
|
||||
browserConnection.ActiveSubscriptionsMutex.Lock()
|
||||
browserConnection.ActiveSubscriptions[queryId] = common.GraphQlSubscription{
|
||||
Id: queryId,
|
||||
Message: fromBrowserMessageAsMap,
|
||||
OperationName: operationName,
|
||||
StreamCursorField: streamCursorField,
|
||||
StreamCursorVariableName: streamCursorVariableName,
|
||||
StreamCursorCurrValue: streamCursorInitialValue,
|
||||
LastSeenOnHasuraConnetion: hc.Id,
|
||||
JsonPatchSupported: jsonPatchSupported,
|
||||
Type: messageType,
|
||||
}
|
||||
// log.Tracef("Current queries: %v", browserConnection.ActiveSubscriptions)
|
||||
browserConnection.ActiveSubscriptionsMutex.Unlock()
|
||||
}
|
||||
// log.Tracef("Current queries: %v", browserConnection.ActiveSubscriptions)
|
||||
browserConnection.ActiveSubscriptionsMutex.Unlock()
|
||||
}
|
||||
|
||||
if fromBrowserMessageAsMap["type"] == "stop" {
|
||||
|
Loading…
Reference in New Issue
Block a user