title: How can I create a Material UI Autocomplete component to work with graphql queries?
body: <p>I'm using React Typescript and have a Autocomplete Material UI component. I'm trying to get query suggestions into Autocomplete component.</p>
  <p>My graphql queries looks like this:</p>
  <p>Query Definition:</p>
  <pre><code>import gql from 'graphql-tag';
  import {useQuery} from 'react-apollo';
  import {Autocomplete} from '@material-ui/lab';
  const TODOS = gql`
    query todos($id: ID!) {
      todo(id: $id) {
        id
        name
      }
    }
  `;
  </code></pre>
  <p>Query Initialization:</p>
  <pre><code>const { loading, error, data } = useQuery(TODOS, {
    variables: { id: 1 }
  });
  </code></pre>
  <p>Autocomplete component</p>
  <pre><code>{loading ? (
                  &lt;p&gt;Loading ...&lt;/p&gt;
                ) : (
                  &lt;&gt;
                    &lt;div&gt;
                      {data &amp;&amp;
                    data.todo &amp;&amp;
                    data.todo.map(
                      (idx: {id: number; name: string}) =&gt; (
                        &lt;Autocomplete
                          id=&quot;combo-box-demo&quot;
                          options={idx.name}
                          getOptionLabel={option =&gt; option.name}
                          style={{width: 300}}
                          renderInput={params =&gt; (
                            &lt;TextField
                              {...params}
                              label=&quot;Combo box&quot;
                              variant=&quot;outlined&quot;
                            /&gt;
                          )}
                        /&gt;
                      )
                    )}
  </code></pre>
  <p>I'm receiving the following errors:</p>
  <ol>
  <li>For line: &quot;options={idx.name}&quot; - Type 'string' is not assignable to type 'unknown[]'.</li>
  <li>For line: &quot;getOptionLabel={option =&gt; option.name}&quot; - Object is of type 'unknown'.</li>
  </ol>
  <p>I had the following problems:</p>
  <ul>
  <li>How can I get this working?</li>
  <li>What is causing this error?</li>
  </ul>