relay
relay copied to clipboard
paginationContainer: refetchConnection is missing
Hello guys, sorry if this issue is already posted.
In the docs we have :
/**
* Refetch the items in the connection (with potentially new variables).
*/
refetchConnection:(
totalCount: number,
callback: (error: ?Error) => void,
refetchVariables: ?Variables,
) => ?Disposable,
But in this method doesn't seems to work. Coz in the transpiled code we don't have "refetchVariables"
_this._refetchConnection = function (totalCount, callback) {
var paginatingVariables = {
count: totalCount,
cursor: null,
totalCount: totalCount
};
return _this._fetchPage(paginatingVariables, callback, { force: true });
};
So if I understand, we have to wrap a paginationContainer in a refetchContainer ?
:)
So I found a solution,
In the transpiled code of relay we don't have the last arguments who is the refetchVariables: ?Variables.
So I clone the relay repo, I build the project myself and finally I replace the ReactRelayPaginationContainer.js newly builded.
And the refetchConnection method work perfectly, I can use a pagination container with refetch and pagination.
I use "react-relay": "^1.1.0" in my package.json