title: Flutter: Querying AWS AppSync
body: <p>I recently started using AWS AppSync &amp; Flutter. I am having a bit of hard time to connect them with each other.</p>
  <p>I am using graphql_flutter package and haven't been able to figure out how to use it for querying  purposes.</p>
  <p>Here is my Code Snippet in question:</p>
  <pre><code>final HttpLink httpLink = HttpLink(
                uri: 'https://myapi.xyz.com/graphql',
              );
  
  
              final AuthLink authLink = AuthLink(
                getToken: () async =&gt; 'Bearer ${globals.token}',  
              );
  
              final Link link = authLink.concat(httpLink);
  
              GraphQLClient client = GraphQLClient(link: link, cache: InMemoryCache());
  
              QueryOptions query = QueryOptions(documentNode: gql(queries.getAll));
  
              var result = await client.query(query);
  </code></pre>
  <p>I am getting below error:</p>
  <pre><code>Error: 'await' can only be used in 'async' or 'async*' methods.
              var result = await client.query(query);  
  </code></pre>
  <p>How can I make the whole thing work?</p>