<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Pedram marandi</title>
    <description>The latest articles on DEV Community by Pedram marandi (@pedrammarandi).</description>
    <link>https://dev.to/pedrammarandi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F103403%2Fc0316d4b-7f93-4bb0-aec2-4533cefe135e.jpg</url>
      <title>DEV Community: Pedram marandi</title>
      <link>https://dev.to/pedrammarandi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pedrammarandi"/>
    <language>en</language>
    <item>
      <title>Some Libraries to empower your Graphql stack</title>
      <dc:creator>Pedram marandi</dc:creator>
      <pubDate>Sat, 29 Sep 2018 02:06:07 +0000</pubDate>
      <link>https://dev.to/pedrammarandi/libraries-you-need-to-use-with-your-graphql-stack-hag</link>
      <guid>https://dev.to/pedrammarandi/libraries-you-need-to-use-with-your-graphql-stack-hag</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qvxLRGvH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/be1cy1wdqw2ait8hapg2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qvxLRGvH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/be1cy1wdqw2ait8hapg2.png" alt="enter image description here"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hi DEV Community 👩‍💻👨‍💻,&lt;/p&gt;

&lt;p&gt;It's been a couple of months since I worked with Graphql for the first time. Without any doubt, I can say it's significantly improved my code quality. If you eager to adopt this stack, I suggest you to have a look at this article about how Graphql advantages and disadvantages "&lt;a href="https://www.robinwieruch.de/why-graphql-advantages-disadvantages-alternatives/"&gt;Why GraphQL: Advantages, Disadvantages &amp;amp; Alternatives&lt;/a&gt;".&lt;/p&gt;

&lt;p&gt;I'm going to write about a set of tools I'm currently using with my Graphql which may help you to get the most out of a Graphql stack. &lt;/p&gt;

&lt;h3&gt;
  
  
  Graphql clients
&lt;/h3&gt;

&lt;p&gt;A good Graphql client can highly improve both front-end and back-end code. They are providing different solutions to cover wide areas in your application like the authentication, caching, fetching data, handling errors and queries. These clients are growing fast and they're gathering a really cool community of developers and I think there is much more potential for them. &lt;/p&gt;

&lt;p&gt;I suggest Apollo, but the followings clients are so cool:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://www.apollographql.com/"&gt;Apollo&lt;/a&gt; (Client &amp;amp; Server)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://graph.cool"&gt;Graph.Cool&lt;/a&gt; (Only server side)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.prisma.io/"&gt;Prisma&lt;/a&gt; (A Graphql ORM for the server side)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://facebook.github.io/relay"&gt;Facebook Relay&lt;/a&gt;  (Front-end)&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Reuse Graphql files
&lt;/h3&gt;

&lt;p&gt;Instead of putting everything in JS files, It's not a bad idea to keep non-JS code out of your Javascript files. To keep Graphql syntaxbeutiful out of our  JS, and also reusing it, we can create .graphql files then with a Webpack loader we can simply import .graphql files. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;import { fetchActiveUsers } from './users.graphql';&lt;/code&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  Graphql playgrounds
&lt;/h3&gt;

&lt;p&gt;Graphql has amazing playgrounds which let you to query your API and fetch results. Exactly like what Postman does for normal API calls. Here is a list of playgrounds I have used:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://github.com/prisma/graphql-playground"&gt;Prisma Playground&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/graphql/graphiql"&gt;Graphiql&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Query Batching &amp;amp; Caching
&lt;/h3&gt;

&lt;p&gt;With Graphql you will get to a point where duplicate queries are being sent to a database and you will need a way to get around this problem. It usually happens when there is hierarchy structure in your data, like an array of posts and authors. For instance, you have 30 posts which are written by 2 authors. A normal Graphql resolver, will query these authors for each post separately. Facebook Dataloader will help you to get around this problem. It will cache data only in a single request so all other parts of the application will pull it from DataLoader cache instead of querying your database. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;DataLoader is a generic utility to be used as part of your&lt;br&gt;
application's data fetching layer to provide a simplified and&lt;br&gt;
consistent API over various remote data sources such as databases or&lt;br&gt;
web services via batching and caching.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://github.com/facebook/dataloader"&gt;Facebook DataLoader&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: DataLoader is not only for Graphql and it's applicable to any other kind of datastores and languages.&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;I can mention more libraries here, but these are the ones which I found essential to have a propper Graphql environment. Let me know if any other libaries appreared helpful in your projects.&lt;/p&gt;

</description>
      <category>graphql</category>
      <category>javascript</category>
      <category>apollo</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>What book(s) has influenced your career?</title>
      <dc:creator>Pedram marandi</dc:creator>
      <pubDate>Wed, 26 Sep 2018 12:44:18 +0000</pubDate>
      <link>https://dev.to/pedrammarandi/what-books-has-influenced-your-career-3e02</link>
      <guid>https://dev.to/pedrammarandi/what-books-has-influenced-your-career-3e02</guid>
      <description>&lt;p&gt;Hello everyone,&lt;/p&gt;

&lt;p&gt;I have recently read &lt;em&gt;The Pragmatic Programmer&lt;/em&gt; book and it significantly influences the way I behave, code, and I think about different aspects of this career.&lt;/p&gt;

&lt;p&gt;I suggest you all have a look at it.&lt;/p&gt;

&lt;p&gt;I'm so eager to read more non-coding books, would be great if you share some with me.&lt;/p&gt;

</description>
      <category>books</category>
      <category>reading</category>
      <category>programming</category>
      <category>discuss</category>
    </item>
  </channel>
</rss>
