Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. this.apollo
  2. .watchQuery({
  3. query: getAllMembers,
  4. })
  5. .valueChanges
  6. .pipe(
  7. tap(returnedData => {
  8. ... does some stuff to one of the returned properties...
  9. })
  10. )
  11. .subscribe(result => {
  12. this.dataSource.data = result.data['getMembers'];
  13. console.log('errors in getAllRecords', result.errors)
  14. });
  15.  
  16. this.apollo
  17. .watchQuery({ // This watchQuery is somehow calling the list's
  18. // watchQuery. There is no code anywhere that does that and
  19. // there were no problems with the original REST code. This is
  20. // a GraphQL thing.
  21. fetchPolicy: 'network-only',
  22. query: getMemberByID,
  23. variables: {
  24. member_id: member_id,
  25. },
  26. })
  27. .valueChanges
  28. .subscribe(result => {
  29. let data = result.data['getMember'];
  30. this.addData(data, skillNames); // Call function below to populate modal.
  31. console.log('errors in view-member', result.errors);
  32. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement