Skip to content

Instantly share code, notes, and snippets.

@jonnysamps
Last active February 25, 2021 00:08
Show Gist options
  • Save jonnysamps/b002d5b84d16d5b58420cd6956124246 to your computer and use it in GitHub Desktop.
Save jonnysamps/b002d5b84d16d5b58420cd6956124246 to your computer and use it in GitHub Desktop.
Apollo Client Best Practices
const query = gql`...`;
timer(0, REFRESH_INTERVAL)
.pipe(
mergeMap(() => apollo.watchQuery({ query }).valueChanges),
map(result => result.data)
)
.subscribe(() => {
// ...
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment