Skip to content

Instantly share code, notes, and snippets.

@roytouw7
Created December 10, 2020 19:04
Show Gist options
  • Save roytouw7/874bfc1a849c965cd4e8b240c7398ef1 to your computer and use it in GitHub Desktop.
Save roytouw7/874bfc1a849c965cd4e8b240c7398ef1 to your computer and use it in GitHub Desktop.
getProducts(): Observable<(Products_allProducts_data)[]> {
return this.apollo.watchQuery<Products>({query: this.query, pollInterval: 120000}).valueChanges.pipe(
map(result => result.data.allProducts.data),
filter((x): x is Products_allProducts_data[] => x !== null)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment