<?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[theDevWay - Medium]]></title>
        <description><![CDATA[/*When developers decide to write in natural language.*/ - Medium]]></description>
        <link>https://medium.com/thedevway?source=rss----c213fd413023---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>theDevWay - Medium</title>
            <link>https://medium.com/thedevway?source=rss----c213fd413023---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 11:32:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/thedevway" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Summer being at our doorstep, we need to get our beach bodies back!]]></title>
            <link>https://medium.com/thedevway/summer-being-at-our-doorstep-we-need-to-get-our-beach-bodies-back-1414a224b215?source=rss----c213fd413023---4</link>
            <guid isPermaLink="false">https://medium.com/p/1414a224b215</guid>
            <category><![CDATA[killabite]]></category>
            <category><![CDATA[office-culture]]></category>
            <category><![CDATA[diet]]></category>
            <category><![CDATA[april-17]]></category>
            <category><![CDATA[health]]></category>
            <dc:creator><![CDATA[Afshing]]></dc:creator>
            <pubDate>Tue, 28 Mar 2017 23:19:05 GMT</pubDate>
            <atom:updated>2017-03-28T23:19:04.718Z</atom:updated>
            <cc:license>http://creativecommons.org/publicdomain/zero/1.0/</cc:license>
            <content:encoded><![CDATA[<p>#KillaBite; a challenge to avoid eating processed snacks at work</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/1*5zxEpkOPeemFefGx-nwMCQ.gif" /><figcaption>From Giphy, <a href="http://gph.is/2cCsahN">http://gph.is/2cCsahN</a></figcaption></figure><p>These days, many companies offer some sort of free snack or food in their offices. It is an interesting and generous perk as far as you stay in shape.</p><p>Because of that, I proposed a simple challenge to my officemates for this April. The concept is quite simple; we are going to avoid eating and drinking any processed food from our snack bar.</p><p>Join us if you like the idea with #KillaBite hashtag, and share your office stories.</p><h3><strong>FAQ</strong></h3><blockquote><strong>How can I feed myself?</strong></blockquote><p>With healthy snacks such as water, milk, coffee, tea, fruits, vegetables, nuts, raisins, etc.</p><blockquote><strong>Why April?</strong></blockquote><p>Because this year, there are only 19 working days in April (4 weekends and one long weekend). And did I mention “Summer is coming?”</p><blockquote><strong>Why April only?</strong></blockquote><p>Baby steps! Let’s start with the April, and we can continue if we like it.</p><blockquote><strong>Can we cheat once or twice?</strong></blockquote><p>My suggestion for cheating is to donate $2 to a food-related cause. (here is <a href="http://care.ca/healthy-food-nutrition">an example</a>)</p><blockquote><strong>But what if I forget the challenge and eat/drink something unhealthy?</strong></blockquote><p>In our office, we are going to post some signs on the fridges and cupboards to remind folks what they can eat and what they can’t! You can do the same.</p><blockquote><strong>Our office doesn’t provide any healthy snacks. Now what?</strong></blockquote><p>Having enough participants, you can replace the unhealthy snack with healthy ones. So share it with your officemates.</p><blockquote><strong>Our office doesn’t provide <em>snacks</em> at all. Now what?</strong></blockquote><p>Still, you can take part by replacing your snack with healthy one!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1414a224b215" width="1" height="1" alt=""><hr><p><a href="https://medium.com/thedevway/summer-being-at-our-doorstep-we-need-to-get-our-beach-bodies-back-1414a224b215">Summer being at our doorstep, we need to get our beach bodies back!</a> was originally published in <a href="https://medium.com/thedevway">theDevWay</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Distributed Schema Creation in GraphQL]]></title>
            <link>https://medium.com/thedevway/distributed-schema-creation-in-graphql-4de949f77cdb?source=rss----c213fd413023---4</link>
            <guid isPermaLink="false">https://medium.com/p/4de949f77cdb</guid>
            <category><![CDATA[hacks]]></category>
            <category><![CDATA[graphql]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[api-design]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Amir Saboury]]></dc:creator>
            <pubDate>Tue, 21 Feb 2017 00:41:22 GMT</pubDate>
            <atom:updated>2017-02-21T00:41:21.961Z</atom:updated>
            <content:encoded><![CDATA[<p>A hack to use GraphQL in a modular framework</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KrSsrnuhREbm3v2fltMqiw.jpeg" /></figure><p><a href="http://graphql.org/">GraphQL</a> is one of the technologies I learned in 2016 and it changed my perspective on API design.</p><p>Simplicity is what I like about GraphQL. It lets you define custom data types (nodes) and their relationships (edges) and that’s it. GraphQL takes care of the rest. There’s no need to go over the benefits of GraphQL over REST and whatnot. There are <a href="https://medium.com/chute-engineering/graphql-in-the-age-of-rest-apis-b10f2bf09bba#.ya1k341z4">more</a> <a href="https://medium.com/@ottovw/rest-api-downfalls-and-dawn-of-graphql-dd00991a0eb8#.ue8iexnu8">than</a> <a href="https://medium.com/soosap/build-a-graphql-server-from-scratch-ff85e1dc6e84#.glq4pm9mb">enough</a> <a href="https://medium.com/@frikille/moving-from-rest-to-graphql-e3650b6f5247#.nisojgye1">material</a> <a href="https://philsturgeon.uk/api/2017/01/24/graphql-vs-rest-overview/">on</a> <a href="https://medium.com/front-end-developers/your-first-graphql-component-ad018e22972c#.jbrbai6k6">that</a> <a href="https://dev-blog.apollodata.com/graphql-explained-5844742f195e#.ve08gjt8x">subject</a>. Here, I want to introduce a problem I had with GraphQL and my solution.</p><p>I’ve decided to ditch REST and use GraphQL in the web framework I’m currently developing using JavaScript. But, there was a big problem. My framework uses a modular architecture. A “Module” is an isolated piece of code that could (1) add new features to the application, or (2) extend the behavior of the existing features or modules.</p><h3>Problem</h3><p>Assume we have a <em>User module </em>for user management. It creates a database table users to maintain the basic information about the users (<em>e.g.</em> name).</p><p>We also have a <em>Permission module</em> to manage users’ permissions. It creates two database tables:</p><ol><li>permission to keep track of all the possible permissions and their label,</li><li>user_permission which maintains a many-to-many relationship between our two entities User and Permission.</li></ol><p><em>User module</em> is independent of <em>Permission module</em> as we desired. In other words, we should be able to remove the <em>Permission module</em> while we still use <em>User module</em> if needed. That’s the design we want to have.</p><p>Now, let’s talk GraphQL again! Specifically <a href="https://github.com/graphql/graphql-js">GraphQL-JS </a>(the official reference implementation of GraphQL for JavaScript).</p><ul><li>How we create GraphQL types for those modules?</li></ul><p>We could have a UserType in the<em> User module</em> and a PermissionType in the <em>Permission module</em>.</p><ul><li><strong>How do we manage the link between these two?</strong> <em>i.e.</em> How we can get the permissions of a user in a one shot?</li></ul><p>We cannot modify UserType in <em>User module</em> and add a permission field. Because this makes <em>User module</em> dependent on <em>Permission module</em> which defeats the purpose of the whole design. Can we create the link from User to Permission in the <em>Permission module</em> by adding a field to our UserType? Well, <strong>no</strong>!</p><p><strong>GraphQL-JS doesn’t allow modifications to the types after creation.</strong> This makes the core implementation simpler. As a result, we can not define our types and schema over different parts of the code.<br>But, when we need to do something and we are not allowed to, that’s where the magic happens!</p><h3>Solution</h3><p>My <strong>idea is to create intermediate data types. These types are not GraphQL types per se but are close enough to create one from them</strong>. Afterward, we are free to extend our intermediate data types in whatever way we design it for. Then, when we finish loading all the modules in the system, we create GraphQL types. Finally, we feed the schema to the GraphQL engine. Note that it’s still a static schema since we can not, and would not change it at runtime.</p><p>To achieve this goal, I wrote a small wrapper around GraphQL-JS which also acts like a registry. Using this wrapper, we will define custom data types inside the registry first. Later, we can get them back anywhere in the code. Here is an example to create and get userType:</p><pre>// defining the type<br>graph.type(&#39;userType&#39;, {<br> name: &#39;User&#39;,<br> description: &#39;User Object&#39;,<br> fields: () =&gt; ({<br>  id: {type: graph.ql.GraphQLInt},<br>  name: {type: graph.ql.GraphQLString}<br> })<br>});</pre><pre>// accessing the type<br>let userType = graph.type(&#39;userType&#39;);</pre><p>Pretty familiar, right? It seems we are still using GraphQL-JS. But, note that graph.type(&#39;userType&#39;) is not a GraphQL type, <strong>yet</strong>.<br>graph also exposes all the built-in GraphQL types through its .ql property, like graph.ql.GraphQLString (basically graph.ql = require(&#39;graphql&#39;);.)</p><p>Also, in our <em>Permission module</em>:</p><pre>graph.type(&#39;permissionType&#39;, {<br> name: &#39;Permission&#39;,<br> fields: () =&gt; ({<br>  id: {type: graph.ql.GraphQLInt},<br>  label: {type: graph.ql.GraphQLString}<br> })<br>});</pre><p>Each type has a .extend(...) function which we can extend the fields of the type. So, we can get userType inside <em>Permission module</em> and extend it with permissions value:</p><pre><strong>graph.type(&#39;userType&#39;)</strong>.extend(() =&gt; ({<br> permissions: {<br>  type: <strong>new graph.ql.GraphQLList</strong>(<strong>graph.type(&#39;permissionType&#39;)</strong>),<br>  resolve: user =&gt; user.getPermissions()<br> }<br>}));</pre><p>.extend inputs a function that returns an object. graph will extend the type’s fields with the provided object.<br>But doesn’t <strong>new graph.ql.GraphQLList</strong> require the input to be a GraphQL type? Yes! graph.type(&#39;...&#39;) will change its behavior and return a solid GraphQL-JS type once we need to finalize the schema! And that makes our wrapper super simple and convenient to use.</p><p>So now we expect the userType to have a permissions field too. And that is cool since the <em>User module</em> doesn’t know anything about it. It’s all in the <em>Permission module</em>!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7LigAZrydE-F55kr8tcjAg.png" /></figure><h3><strong>How does this work?</strong></h3><p>We keep all our intermediate types in an internal object rawTypes. But we don’t store all the fields in an object. Instead, we keep them as an array of objects. Each element of the array would be a function that returns an extra bit of information about what should go into the fields of the final type! So, extending would be as easy as pushing a function into that array:</p><pre>extend: fields =&gt; rawTypes[name].fields.push(fields);</pre><pre>// Or to be more dev friendly, if the input is not a function,<br>// convert it to one.<br>extend: fields =&gt; rawTypes[name].fields.push(fields instanceof Function ? fields : () =&gt; fields)</pre><p>When finalizing the schema, we create GraphQLObjectType from our raw types. But, GraphQLObjectType expects the fields to be just <strong>one simple function</strong> that returns the fields object, not an array. We need to convert all those functions to a single function. This is a one line solution for that purpose:</p><pre>let fnFromArray = fns =&gt; () =&gt; fns.reduce((obj, fn) =&gt; Object.assign({}, obj, fn.call()), {});</pre><p>fnFromArray inputs the array of the functions and returns another function. The “returning function”, goes over all those input functions and call them. Then using Object.assign and reduce, it merges the returning values into one object.</p><p>Also, we create a query and mutation types internally so other <em>modules</em> could extend those to add their own starting points in the query.</p><pre>graph.type(&#39;query&#39;).extend(() =&gt; ({<br> allUsers: {<br>  type: new graph.ql.GraphQLList(graph.type(&#39;userType&#39;)),<br>  resolve: () =&gt; User.findAll()<br> }<br>}));</pre><p>graph exposes a .generate() function which locks down our intermediate types. Then, it creates GraphQL-JS types from them. It replaces the intermediate types with the real ones once it creates them. So, graph.type(&#39;...&#39;) would return a GraphQL-JS type and lines like new graph.ql.GraphQLList(graph.type(&#39;...&#39;)) become valid.</p><p>This workaround is not a production-ready code. This is only an idea on how we can achieve these things using a bit of hack and code!</p><p>You can find this GraphQL wrapper on npm (<a href="https://www.npmjs.com/package/graphql-dschema">graphql-dschema)</a> and it source code on <a href="https://github.com/amir-s/graphql-distributed-schema">Github</a>. Feel free to raise issues or suggest improvements on Github issues or in this post comments. You can also find a small working example on <a href="https://github.com/amir-s/graphql-distributed-schema-example">this repo</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4de949f77cdb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/thedevway/distributed-schema-creation-in-graphql-4de949f77cdb">Distributed Schema Creation in GraphQL</a> was originally published in <a href="https://medium.com/thedevway">theDevWay</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I am a Recruiter (a.k.a Spammer) at Amazon]]></title>
            <link>https://medium.com/thedevway/i-am-a-recruiter-a-k-a-spammer-at-amazon-6520ea0b031?source=rss----c213fd413023---4</link>
            <guid isPermaLink="false">https://medium.com/p/6520ea0b031</guid>
            <category><![CDATA[remote-working]]></category>
            <category><![CDATA[recruiting]]></category>
            <category><![CDATA[amazon]]></category>
            <category><![CDATA[thedevway]]></category>
            <category><![CDATA[basecamp]]></category>
            <dc:creator><![CDATA[Afshing]]></dc:creator>
            <pubDate>Tue, 24 Jan 2017 15:02:31 GMT</pubDate>
            <atom:updated>2017-02-02T19:16:31.214Z</atom:updated>
            <content:encoded><![CDATA[<p>A love story of me and Amazon recruiters</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qnbvU2p1dUtZ0e-5V95MMw.jpeg" /></figure><p>Almost every three months, I receive an email from a recently hired Amazon recruiter. A cold email for an “exciting unique opportunity” in Amazon (or AWS,) either in Seattle, Vancouver or Toronto. All offer relocation and none of them allow remote working.</p><p>For many, relocating for an opportunity makes sense. To me what makes more sense is a leader in remote service providing should be able to provide a remote workspace.</p><ul><li>Amazon enables customers to buy almost everything online from anywhere.</li><li>Amazon Web Services (AWS) enable clients to host almost any kind of service in the cloud and control it from anywhere.</li><li>And, Amazon believes in “<a href="https://www.amazon.jobs/principles">hiring and developing the best</a>” from anywhere, only if they move.</li></ul><p>Despite their values, Amazon cannot “think big” and “invent and simplify” a working environment that enables remote working.</p><p>It is understandable for an old-fashioned big company not to believe in remote working. But, why an innovative company working on cloud products cannot enable it on a large scale? The company that its <a href="https://basecamp.com/about">CEO invests in basecamp</a>; a company famous for its <a href="https://37signals.com/remote">book </a>about the concept.</p><p>But this is not what bothers me. What bothers me is the fact that, on average, every three months they approach to the same potential passive candidate for the same type of position!</p><p>I want to remind the Amazon human resource and recruitment team that you have many talented software developers in your company. And, these folks can create a database of do-not-want-to-move candidates for you, and you can ask your recruiting team not to spam them! A simple cross join!</p><p>It is not only unacceptable but also shameful for a software company to send <strong>over 16 cold emails</strong> to the same candidate who is not interested. In the most recent one, I received two messages from the same recruiter in a week!<br>The following is part of her second email after I explained to her that <strong>I am not interested in any opportunities and not considering relocation</strong>.</p><blockquote><strong>We are looking for Software Development Engineers for roles in</strong> <strong>Vancouver, BC. </strong>Based on what we know about you, we feel you could make a significant impact on one of these teams.</blockquote><p>Based on what you know about me, you shouldn’t send this email! Even if you want to spam, spam based on data, please!</p><p>In simple words, many companies have broken head hunting process, but I am not sure Amazon even has one.</p><p>P.S1 I wrote the draft of this post while ago, but I decided not to post it publicly until the same scenario happens. Yesterday I got another cold message in LinkedIn, from a new Amazon recruiter. I want to reply the link to this post as his response.</p><p>P.S2 More comments and discussions in <a href="https://news.ycombinator.com/item?id=13495191">HackerNews</a></p><p>UPDATE: Although this post got viral for couple of hours in HackerNews, I am still getting emails from Amazon recruiters. Great job folks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6520ea0b031" width="1" height="1" alt=""><hr><p><a href="https://medium.com/thedevway/i-am-a-recruiter-a-k-a-spammer-at-amazon-6520ea0b031">I am a Recruiter (a.k.a Spammer) at Amazon</a> was originally published in <a href="https://medium.com/thedevway">theDevWay</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The DevWay]]></title>
            <link>https://medium.com/thedevway/the-devway-79ed086c95d0?source=rss----c213fd413023---4</link>
            <guid isPermaLink="false">https://medium.com/p/79ed086c95d0</guid>
            <category><![CDATA[hello-world]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[thedevway]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[medium]]></category>
            <dc:creator><![CDATA[Afshing]]></dc:creator>
            <pubDate>Sun, 18 Dec 2016 22:09:08 GMT</pubDate>
            <atom:updated>2016-12-18T23:44:14.361Z</atom:updated>
            <content:encoded><![CDATA[<h4>Developers are writing …</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f_AhCyQoZ3a_xtiVDMxTJw.png" /></figure><p>For a while now, we wanted to start a blog about our thoughts, opinions, and hacks as developers; about how a developer sees the world, hacks life, learns stuff, and so on. But, every time we wanted to start writing, coding (or gaming) distracted us!</p><p>So, we decided to do this in the dev way!</p><p>First, we created a project plan (A.K.A a Google keep todo list), where we list the potential topics we would like to talk about.</p><p>Second, a deadline is needed. Because a deadline is always needed. So, we chose the end of December 2016 for our first post.</p><p>Finally, we discussed about how/where to write.</p><blockquote>Amir: Which platform should we use?</blockquote><blockquote>Afshin: A simple blog in Medium?</blockquote><blockquote>Amir: Or, maybe a client for Medium where we can write as markdown, and it posts it through that?</blockquote><blockquote>Afshin: Plus an extension on Git where we can keep track of our drafts?</blockquote><blockquote>Amir: And a web-based review tool that we can review our posts?</blockquote><blockquote>Afshin: With an embedded bot that can review our posts, and fix issues through a Grammarly client?</blockquote><blockquote>Amir: And an AI-powered client that rephrase our basic sentences to fancy English ones? 🚀</blockquote><blockquote>Afshin: Or maybe a unicorn that asks us some questions about what we think, and write a blog post about it? 🦄</blockquote><blockquote>Amir: Or a mind-reader unicorn to automate the Q&amp;A phase? 🎩</blockquote><p>And then, we realized that we only have few days to get shit done! So, we phased out “some” features to the next releases, and said hello to the world in Medium (<a href="https://m.signalvnoise.com/medium-has-been-great-for-us-35d9b0cc665d#.1ae04tfrs">as suggested be </a><a href="https://m.signalvnoise.com/@jasonfried?source=post_header_lockup">Jason Fried</a>.)</p><p>More are coming (hopefully!)</p><p>Cheers,</p><p><a href="https://github.com/afshing">Afshin</a> &amp; <a href="https://github.com/amir-s/">Amir</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79ed086c95d0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/thedevway/the-devway-79ed086c95d0">The DevWay</a> was originally published in <a href="https://medium.com/thedevway">theDevWay</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>