RefetchContainer

RefetchContainer

A RefetchContainer first renders like a regular FragmentContainer, but has the option to execute a new query with different variables and render the response of that query instead when the request comes back.

this.props.relay exports the following API to execute the refetch query:

type Variables = {[name: string]: any};
type RefetchOptions = {
  force?: boolean, // Refetch even if already fetched this query and variables.
};
type Disposable = {
  dispose(): void,
};

/**
 * Execute the refetch query
 */
refetch: (
  refetchVariables: Variables | (fragmentVariables: Variables) => Variables,
  renderVariables: ?Variables,
  callback: ?(error: ?Error) => void,
  options?: RefetchOptions,
) => Disposable,