How to use the apollo-client.NetworkStatus.refetch function in apollo-client

To help you get started, we’ve selected a few apollo-client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github elastic / kibana / x-pack / legacy / plugins / siem / public / containers / query_template_paginated.tsx View on Github external
public isItAValidLoading(loading: boolean, variables: TVariables, networkStatus: NetworkStatus) {
    if (
      !this.myLoading &&
      (!isEqual(variables, this.queryVariables) || networkStatus === NetworkStatus.refetch) &&
      loading
    ) {
      this.myLoading = true;
    } else if (this.myLoading && !loading) {
      this.myLoading = false;
    }
    this.setPrevVariables(variables);
    return this.myLoading;
  }
}
github apollographql / react-apollo / packages / components / lib / react-components.esm.js View on Github external
error: function (error) {
                    var previousResult = _this.previousResult;
                    if (!previousResult ||
                        previousResult.networkStatus === NetworkStatus.refetch) {
                        _this.resubscribeToQuery(client);
                    }
                    if (!error.hasOwnProperty('graphQLErrors'))
                        throw error;
                    _this.updateCurrentData();
                },
            });
github apollographql / react-apollo / packages / components / lib / Query.js View on Github external
error: function (error) {
                    var previousResult = _this.previousResult;
                    if (!previousResult ||
                        previousResult.networkStatus === NetworkStatus.refetch) {
                        _this.resubscribeToQuery(client);
                    }
                    if (!error.hasOwnProperty('graphQLErrors'))
                        throw error;
                    _this.updateCurrentData();
                },
            });