<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Victor Syrotin on Medium]]></title>
        <description><![CDATA[Stories by Victor Syrotin on Medium]]></description>
        <link>https://medium.com/@syrotinvictor?source=rss-e4df36539eda------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Victor Syrotin on Medium</title>
            <link>https://medium.com/@syrotinvictor?source=rss-e4df36539eda------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 08:39:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@syrotinvictor/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to send request from Angular to GraphQL endpoint]]></title>
            <link>https://medium.com/@syrotinvictor/how-to-send-request-from-angular-to-graphql-endpoint-731355e9203f?source=rss-e4df36539eda------2</link>
            <guid isPermaLink="false">https://medium.com/p/731355e9203f</guid>
            <category><![CDATA[graphql]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Victor Syrotin]]></dc:creator>
            <pubDate>Sat, 11 Feb 2023 15:37:20 GMT</pubDate>
            <atom:updated>2023-02-11T15:37:51.175Z</atom:updated>
            <content:encoded><![CDATA[<p>To send a request from Angular to a GraphQL endpoint, you can use a GraphQL client library, such as Apollo Client. Here’s an example of how you can use Apollo Client to send a query:</p><ol><li>First, you’ll need to install the Apollo Client library in your Angular project. You can do this by running the following command in your terminal:</li></ol><pre>npm install @apollo/client</pre><p>2. Next, you’ll need to import the ApolloClient and HttpLink modules in your Angular component or service:</p><pre>import { ApolloClient, HttpLink, InMemoryCache } from &#39;@apollo/client&#39;;<br>import { Observable } from &#39;rxjs&#39;;<br>import { map } from &#39;rxjs/operators&#39;;<br>import { gql } from &#39;apollo-boost&#39;;</pre><p>3. Then, you’ll need to create an instance of the ApolloClient and configure it to use the HttpLink to communicate with your GraphQL API endpoint:</p><pre>const apolloClient = new ApolloClient({<br>  link: new HttpLink({ uri: &#39;https://your-graphql-endpoint.com/graphql&#39; }),<br>  cache: new InMemoryCache()<br>});</pre><p>4. Finally, you can use the query method of the ApolloClient instance to send a query to the GraphQL API:</p><pre>const query = gql`<br>  query {<br>    yourQueryName {<br>      yourField1<br>      yourField2<br>    }<br>  }<br>`;<br>apolloClient<br>  .query({<br>    query: query<br>  })<br>  .subscribe(result =&gt; console.log(result.data));</pre><p>This is a basic example of how you can send a GraphQL query using Apollo Client in Angular. You can find more information and additional examples in the official Apollo Client documentation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=731355e9203f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>