Search code examples
relayjs

"getPendingTransactions" returns null


When I have call applyUpdate on a mutation and then call getPendingTransactions I get null, no transactions returned basically. I have tried to track down the problem and this._queuedRecords in the file RelayRecordStore.js gives me null which I think is the cause of it.

This line: https://github.com/facebook/relay/blob/master/src/store/RelayRecordStore.js#L271

Could it be that getPendingTransactions does not return UNCOMMITED commits?


Solution

  • The problem was because of a wrong implementation of mutations. To get this.queuedRecords to show not null, I needed getOptimisticResponse in my mutation. I was also using REQUIRED_CHILDREN, but not sure if that was part of the problem. Anyways, I changed it to RANGE_??? instead.