title: Flutter graphql cache update works only once
body: <pre><code>static Future&lt;QueryResult&gt; updateOrderStatus({required dynamic input, required String status, required String orderId, required String buyerId}) {
      final client = GraphqlClient.getGraphQlClient();
      print(input);
  
      final MutationOptions options = MutationOptions(
        document: gql(OrderMutaions.updateOrderStatus),
        variables: {'input': input},
        update: (cache, result) {
          print(orderId);
          print(buyerId);
          final req = QueryOptions(
            document: gql(OrderQueries.getOrderByOrderId),
            variables: {
              'input': {&quot;orderId&quot;: orderId, &quot;buyerUid&quot;: buyerId},
            },
          ).asRequest;
  
          final response = cache.readQuery(req);
  
          print('cache response');
          print(response);
  
          response?[&quot;getOrderByOrderId&quot;][&quot;status&quot;] = status;
  
          print('cache response new');
          print(response);
  
          if (response != null) {
            cache.writeQuery(
              req,
              broadcast: true,
              data: response,
            );
          }
  
          return cache;
        },
      );
  
      return client.mutate(options);
    }
  </code></pre>
  <p>I am using <a href="https://pub.dev/packages/graphql" rel="nofollow noreferrer">this package</a> to use graphql in flutter as I don't want to use query/mutation widgets. I am using watchQuery for getOrderByOrderId and listening to changes. When updateOrderStatus query is called I update cache so watchQuery gets the changes. However when the first time status changes it works fine. cache is updated and watchquery gets the changes. But when next time status is again changed cache.readQuery(req) returns null value for given query. Hence this works only once. I don't understad why second time is gets null. Where is the mistake?</p>