<?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 kolawole Olulana on Medium]]></title>
        <description><![CDATA[Stories by kolawole Olulana on Medium]]></description>
        <link>https://medium.com/@kolawolegolulana?source=rss-458449262674------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*vRKYZwBMSC6xYuFp.</url>
            <title>Stories by kolawole Olulana on Medium</title>
            <link>https://medium.com/@kolawolegolulana?source=rss-458449262674------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 17:56:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kolawolegolulana/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[Getting Started With GraphQL and Angular]]></title>
            <link>https://medium.com/@kolawolegolulana/getting-started-with-graphql-and-angular-a22620e0d0b?source=rss-458449262674------2</link>
            <guid isPermaLink="false">https://medium.com/p/a22620e0d0b</guid>
            <category><![CDATA[graphql]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[full-stack]]></category>
            <dc:creator><![CDATA[kolawole Olulana]]></dc:creator>
            <pubDate>Wed, 29 Jan 2020 07:06:19 GMT</pubDate>
            <atom:updated>2020-01-29T17:24:52.313Z</atom:updated>
            <content:encoded><![CDATA[<h3>Consuming GraphQL API with Apollo Client and Angular 8</h3><p>In this article, I’ll introduce you to the basic concepts to get you started with GraphQL concepts. I will run through what makes GraphQL API a better option than REST API for data driven and bulky application, not that GraphQL is limited to such type of application.</p><p>At the end of this article,</p><ul><li>You will understand the GraphQL advantage over REST</li><li>You will understand what a Schema is, and how to execute them</li><li>You will understand how the Query, Subscription and a Mutation concept in GraphQL are implemented</li><li>You will write a resolver function</li></ul><h3>Creating Your Angular App</h3><p>Install angular and create a new project and start the server</p><pre>$ npm install -g @angular/cli<br>$ ng new graphql-angular-demo<br>// Select Default Options<br>$ cd graphql-angular-demo<br>$ ng serve<br></pre><p>You can view it at <a href="http://localhost:4200/">http://localhost:4200</a></p><h3>Create Angular Component to Display GraphQL Data</h3><pre>$ ng generate component books</pre><p>Next, is to add this component to your app routing open <strong><em>src/app/app-routing.module.ts </em></strong><em>and edit as shown below</em></p><pre>import { NgModule } from &#39;@angular/core&#39;;<br>import { Routes, RouterModule } from &#39;@angular/router&#39;;<br>import { BooksComponent } from &#39;../app/books/books.component&#39;</pre><pre>const routes: Routes = [<br>{</pre><pre>path: &#39;books&#39;,</pre><pre>component: BooksComponent</pre><pre>}</pre><pre>]</pre><pre>@NgModule({</pre><pre>imports: [RouterModule.forRoot(routes)],</pre><pre>exports: [RouterModule]</pre><pre>})</pre><pre>export class AppRoutingModule { }</pre><p>You can view the new route at <a href="http://localhost:4200/books">http://localhost:4200/books</a></p><h3>Now Add Apollo Client to your Angular Project</h3><p>In order to be able to consume the data from GraphQL API, you add apollo to your angular project, to do so run the following</p><pre>$ ng add apollo-angular<br>$ sudo npm install apollo-angular-link-http --save</pre><h3>Modelling Your GraphQL Schema</h3><p>We define our schema for our data types according, in this case a Book which will have the following structure</p><pre>type Book {<br>  id: ID!<br>  title: String<br>  author: String<br>  isbn: String<br>  published: String<br>  summary: String<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a22620e0d0b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>