4

I'm trying to use createRefetchContainer of the Relay Modern. but the props aren't passed down to my component from the result of the refetch query. The refetch query runs okay and the response will come back from the server, but the ui doesn't get updated. or to be more precise the props of the refetch container don't get updated.

Here is my relay decorator:

@compose(
  queryRenderer(graphql`
      query UsersQuery($page: Int, $count: Int) {
          users(page: $page, count: $count) {
              ...Users_users
          }
      }
  `, {
    page: 1,
    count: 25
  }),
  refetchContainer(
    graphql`
        fragment Users_users on UserPaginationResult {
            data {
                ...UserRow_user
            }
            pageInfo {
                totalCount
                pagesCount
            }
        }
    `,
    graphql`
        query UsersRefetchQuery($page: Int!,$count: Int!) {
            users(page: $page, count: $count) {
                ...Users_users
            }
        }
    `
  )
)

And here is my refetch function:

loadMore(page) {
    const { count } = this.state;
    const { relay: { refetch } } = this.props;

    refetch({ page, count });
  }

versions:

"react-relay": "^1.4.1",
"relay-compose": "^1.0.6",
"relay-runtime": "^1.4.1"
Mani Shooshtari
  • 760
  • 1
  • 6
  • 19

0 Answers0