Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. http://domainname/api/v1:id
  2.  
  3. { elemetnt { id, name } }
  4.  
  5. let queryParam = `{ elemetnt { id, name } }`;
  6. this.http.post(`http://domainname/api/v1:1`, {
  7.  
  8. query: queryParam,
  9.  
  10.  
  11.  
  12. }, {
  13. headers: new Headers({
  14. 'Content-Type': 'application/graphql',
  15. }),
  16. })
  17. .catch((error: Response | any) => {
  18.  
  19. console.log(error);
  20. return Observable.of(error);
  21. })
  22. .subscribe((res) => {
  23.  
  24. console.log(JSON.stringify(res));
  25.  
  26. });
  27.  
  28. queryParam= { element : { id: "0000" , name: "name" };
  29.  
  30. {"query":"{ elemetnt { id, name } }" }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement