title: Refetch query in apollo client
body: <p>So I'm trying to build a small search app. The problem I'm encountering is that I can't refetch the query when the state of text input changes. here's the code</p>
  
  <pre><code>getInitialState: function(){
   return {
    searchParams: '' "
   }
  },
  render: function(){
   return (
     &lt;View style={styles.container}&gt;
       &lt;SearchBar goSearch={this.goSearch}/&gt;
       &lt;SearchResults searchParams={this.state.searchParams} /&gt;
     &lt;/View&gt;
    )
   },
   goSearch: function(searchParams){
     this.setState({searchParams: searchParams});
    }
  </code></pre>
  
  <p>So I have this parent component that has searchBar component that's the search bar where user enters the search query, and searchResults component that renders the results. Go Search function as u can see changes the state whenever the text changes in the searchBar component. Now for the searchResults component..</p>
  
  <pre><code>componentWillReceiveProps(nextProps){
  if(this.props.searchParams!=nextProps.searchParams){
    console.log("props changed " + nextProps.searchParams)
    this.props.data.refetch();
    console.log(this.props.data.refetch)
  }
  </code></pre>
  
  <p>},</p>
  
  <pre><code>render: function(){
   return ( 
    &lt;View&gt;
     {this.renderPosts()}
    &lt;/View&gt;
   )
  },
  
  module.exports = graphql(fetchFilterPosts, {
   options: (props) =&gt; {
   return {
     variables: {searchParams:props.searchParams}
    }
  }
  })(SearchResults);
  </code></pre>
  
  <p>What im trying to do here is that when the state of the parent component changes, It will be passed in the searchResult component as a prop, and it's passed as a variable in the graphQL query. Now the problem is that I can't refetch it when the props change. I have setup componentWillReceiveProps to check if the props changes and refetch the data but it doesn't seem to work. I've Read some articles about subscriptions and updateQueries, but I'm not sure if thats the solution I'm looking for. Need desperate help. Thanks in advance </p>