title: Must contain a query definition
body: <p>Iam new to react-native and appsync,graphql.we are trying to implement an appsync app using react-native when i tried to run its is throwing an error saying </p>
  
  <blockquote>
    <p>14:16:38: Must contain a query definition.
    * null:null in getQueryDefinition
    - node_modules/apollo-cache-inmemory/lib/bundle.umd.js:649:64 in diffQueryAgainstStore
    - node_modules/apollo-cache-inmemory/lib/bundle.umd.js:559:32 in readQueryFromStore
    - node_modules/apollo-cache-inmemory/lib/bundle.umd.js:899:38 in read
    - node_modules/apollo-cache-inmemory/lib/bundle.umd.js:992:23 in readQuery
    * null:null in update
    - node_modules/apollo-client/bundle.umd.js:1609:0 in 
    - node_modules/apollo-utilities/lib/bundle.umd.js:818:21 in tryFunctionOrLogError
    * null:null in 
    - node_modules/apollo-cache-inmemory/lib/bundle.umd.js:961:22 in performTransaction
    - node_modules/apollo-client/bundle.umd.js:1473:0 in markMutationResult
    - node_modules/apollo-client/bundle.umd.js:797:20 in next
    - node_modules/zen-observable-ts/node_modules/zen-observable/lib/Observable.js:150:3 in notifySubscription
    - node_modules/zen-observable-ts/node_modules/zen-observable/lib/Observable.js:195:5 in onNotify
    * null:null in next
    - node_modules/zen-observable-ts/node_modules/zen-observable/lib/Observable.js:150:3 in notifySubscription
    * null:null in flushSubscription
    - node_modules/zen-observable-ts/node_modules/zen-observable/lib/Observable.js:190:26 in 
    * null:null in 
    - node_modules/promise/setimmediate/core.js:37:14 in tryCallOne
    - node_modules/promise/setimmediate/core.js:123:25 in 
    - ... 10 more stack frames from framework internals</p>
  </blockquote>
  
  <p>I tried to trace out the error in apollo-cache but i couldnt find one.Am getting this when ever i press send button.</p>
  
  <pre><code>import React, { Component } from 'react';
  import { KeyboardAvoidingView, Text, Button, TextInput, StyleSheet, Alert } from 'react-native';
  
  export default class ChatInput extends Component {
  
    constructor(props) {
        super(props);
        this.userid = props.userid;
        this.state = {
            text: ''
        }
    }
  
    handleSend = () =&gt; {
        if (this.state.text === '') {
            return false;
        }
        const chat = {
            userid: this.userid,
            text: this.state.text,
            createdAt: new Date().toISOString()
        }
        this.props.onSubmit(chat);
        this.setState({
           text: ''
        })
        this.textInput.clear();
    }
  
    render() {
      return (
      &lt;KeyboardAvoidingView&gt;
          &lt;TextInput ref={input =&gt; { this.textInput = input }} placeholder="Message.." 
          onChangeText={(text) =&gt; this.setState({text})} onSubmitEditing={this.handleSend} 
          autoFocus={true} blurOnSubmit={false} returnKeyType="send"&gt;&lt;/TextInput&gt;
          &lt;Button title="Send" onPress={this.handleSend}&gt;&lt;/Button&gt;
      &lt;/KeyboardAvoidingView&gt;
      );
    }
  }
  
  
  
   const ChatInputData = compose(
      graphql(PostMessage, {
          options: {
              fetchPolicy: 'no-cache'
          },props: (props) =&gt; ({
                  onSubmit: chat =&gt; {
                      props.mutate({
                          variables: chat,
                          optimisticResponse: {
                              __typename: 'Mutation',
                              post: {
                                  __typename: ChatHistory,
                                  id: chat.createdAt,
                                 userid: chat.userid,
                                  text: chat.text,
                                  createdAt: chat.createdAt
                              }
                          },
                          update: (proxy, {data: {post}}) =&gt; {
                              const data = proxy.readQuery({ query: PostMessage });
                              data.listPostMessages.items.push(Object.assign({}, post));
                              proxy.writeData({query: listPostMessages, data});
                          }
                      })
                  }
              })
          })
      )(ChatInput)
  </code></pre>
  
  <p>Please help me out!.Thanks in advance</p>