`NetworkStatus.loading` available globally on `ApolloClient`?
See original GitHub issueIs there any way to determine whether NetworkStatus.loading
is true for any currently executing ApolloClient
operation?
I’d like to create an application-wide network activity indicator component in an Apollo-Angular project without having each Apollo client .query
/.watchQuery
/.mutate
call report its NetworkStatus.loading
. I thought of using middleware/afterware hooks in ApolloClientConfig.networkInterface
, but since the Apollo client is configured in the AppModule
decorator, it’s not easy to construct a hook that would report Apollo network activity in a way that would be available to an Angular component via an injected service.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Handling operation errors - Apollo GraphQL Docs
Apollo Client can encounter a variety of errors when executing operations ... const { loading, error, data } = useQuery(MY_QUERY, { errorPolicy: "all"...
Read more >Global Loading Flag for Apollo Client - Stack Overflow
I've just released a library that solves this for Apollo 2: react-apollo-network-status. The gist is: import React, {Fragment} from 'react'; ...
Read more >react-apollo-network-status - npm package - Snyk
Brings information about the global network status from Apollo into React. This library helps with implementing global loading indicators like progress bars or ......
Read more >Optimistic UIs with React, Apollo Client and TypeScript (Part I)
To make the Apollo Client instance available throughout the entire ... current user globally available to the application's component tree.
Read more >How to set up a React Apollo client with a Graphcool GraphQL ...
Apollo Client is a GraphQL client (alternative to Relay) that can be used with ... Error: fetch is not found globally and no...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks so much! With the help of the
apollo-client
andangular-apollo
migration guides, thehowtographql/angular-apollo
example, and @kamilkisiela’s expert guidance, I got our project upgraded to ApolloClient 2.0.1 + Angular-Apollo 1.0.0 withapollo-angular-link-http
. I successfully tested a third-party Angular network activity/loading component that intercepts AngularHttpClient
used byapollo-angular-link-http
, so for now I’ll leave my custom link writing to the one I needed for Meteor authentication withapollo-angular-link-http
:@KeithGillette that’s great! Thanks to using
HttpClient
we gain so many things like NativeScript support, SSR, features like that one you mentioned! If you have any questions feel free to message me on slack (same user handle)