loyal
loyal

Reputation: 257

how to use QraphQL without local cache in flutter

Problem is that I need to fetch data from the server, but it returns local cache data. So it has a different value from the server.

  final HttpLink httpLink = HttpLink("URL");

  final AuthLink authLink = AuthLink(
        getToken: () => "Token", headerKey: "auth"
  );

  final Link link = authLink.concat(httpLink);

  GraphQLClient  client = GraphQLClient(
      cache: GraphQLCache(store: HiveStore()),
      link: link,
    );

 ValueNotifier<GraphQLClient> notifierClient = ValueNotifier(client);

Upvotes: 0

Views: 307

Answers (1)

MobIT
MobIT

Reputation: 980

You can define GraphQLClient without store.

GraphQLClient client = GraphQLClient(
  cache: GraphQLCache(),
  link: link,
);

Upvotes: 1

Related Questions