<?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 David A. Viramontes on Medium]]></title>
        <description><![CDATA[Stories by David A. Viramontes on Medium]]></description>
        <link>https://medium.com/@dviramontes_?source=rss-4aa8a05bc27a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*doD-_kgkOxtkcqOsJ7PiRA.jpeg</url>
            <title>Stories by David A. Viramontes on Medium</title>
            <link>https://medium.com/@dviramontes_?source=rss-4aa8a05bc27a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 20:40:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dviramontes_/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[Using multiple spaces in Contentful with GraphQL]]></title>
            <link>https://medium.com/mmmanyfold/using-multiple-spaces-in-contentful-with-graphql-44c9fb74a119?source=rss-4aa8a05bc27a------2</link>
            <guid isPermaLink="false">https://medium.com/p/44c9fb74a119</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[graphql]]></category>
            <category><![CDATA[contenful]]></category>
            <dc:creator><![CDATA[David A. Viramontes]]></dc:creator>
            <pubDate>Mon, 29 Jan 2018 23:38:08 GMT</pubDate>
            <atom:updated>2018-01-29T23:38:08.657Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/142/1*DrG_Uj8N4ccttLxtxPuWpQ.png" /></figure><p><a href="https://www.contentful.com/blog/2017/05/22/running-graphql-queries-in-contentful/">Back in May 2017 it became possible to develop Contentful powered apps backed by GraphQL queries</a>. Here at <a href="http://www.mmmanyfold.com/">mmmanyfold</a>, we are very big fans of both <a href="https://www.howtographql.com/">GraphQL</a> and <a href="https://www.contentful.com/">Contentful</a> so we were pretty excited to try it out for ourselves. The client project we had in mind required us to use multiple content <a href="https://www.contentful.com/r/knowledgebase/spaces-and-organizations/#what-are-spaces-and-organizations">spaces</a> (spaces are a way to manage your content entries, content types and media assets in Contentful).</p><p><a href="https://www.contentful.com/developers/docs/javascript/tutorials/how-to-get-started-with-graphql-and-contentful/">We followed this guide in order to set it all up on our end</a>, but soon realized this approach is limited to using one space -__-. In order to get around this problem we modified the sample code a bit and came up with this:</p><p><a href="https://github.com/mmmanyfold/contentful-graphql-server">mmmanyfold/contentful-graphql-server</a></p><p>See ./server.js for implementation details.</p><p>This approach is working well for us but we would like to continue to improve it to be more <a href="https://en.wikipedia.org/wiki/Don%27t_repeat_yourself">DRY</a>, and include some unit tests. Perhaps we could even refactor the space configuration to a separate JSON file? Stay tuned…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44c9fb74a119" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mmmanyfold/using-multiple-spaces-in-contentful-with-graphql-44c9fb74a119">Using multiple spaces in Contentful with GraphQL</a> was originally published in <a href="https://medium.com/mmmanyfold">mmmanyfold</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to build your own Promise.all using $.when]]></title>
            <link>https://medium.com/mmmanyfold/how-to-build-your-own-promise-all-using-when-51f45ef4f470?source=rss-4aa8a05bc27a------2</link>
            <guid isPermaLink="false">https://medium.com/p/51f45ef4f470</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[jquery]]></category>
            <category><![CDATA[es6]]></category>
            <category><![CDATA[internet-explorer]]></category>
            <category><![CDATA[promises]]></category>
            <dc:creator><![CDATA[David A. Viramontes]]></dc:creator>
            <pubDate>Mon, 29 Jan 2018 03:00:47 GMT</pubDate>
            <atom:updated>2018-01-29T05:58:02.728Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p74sh8ILi4X7n8XkuEXqVw.png" /></figure><p>At <a href="http://www.mmmanyfold.com/">mmmanyfold</a>, we recently had a project where we needed the functionality of an ES6 feature called <a href="https://github.com/lukehoban/es6features#promises">Promise.all</a> (also <a href="https://docs.angularjs.org/api/ng/service/$q#all">known as $q.all in angular</a>) in order to batch multipleGET requests. We wanted to be able to do something like this</p><pre>const post_ids = [1,2,3,4,5,6];<br>const endpoint = &quot;<a href="https://jsonplaceholder.typicode.com/posts/$%7Bid%7D%60">https://jsonplaceholder.typicode.com/posts/</a>&quot;;</pre><pre>Promise.all(post_ids.map(id =&gt; fetch(`endpoint<a href="https://jsonplaceholder.typicode.com/posts/$%7Bid%7D%60">${id}`</a>))<br> .then(responses =&gt; console.log(responses)));</pre><p>However, being mindful of adding extra dependences to the project and cross browser compatibility (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all">looking at you IE11 with no native promise support :’</a>&lt;). We decided to roll our own using existing jQuery 2.1.4 dependency already in the project.</p><pre>var post_ids = [1,2,3,4,5,6];<br>var endpoint = &quot;<a href="https://jsonplaceholder.typicode.com/posts/$%7Bperson%7D%60">https://jsonplaceholder.typicode.com/posts/</a>&quot;;</pre><pre>var requests = post_ids.map(function(id) {<br>  return $.getJSON(endpoint + id);<br>});</pre><pre>$.when.apply(this, requests) <br>  .done(function(post1, post2, post3, ...) {<br>    // process responses<br>  })<br>  .fail(function(errors) {<br>    // handle errorrs<br>  });</pre><p>Hopefully this helps someone else out there looking to replicate this specific native Promise functionality which<a href="https://stackoverflow.com/questions/22516959/how-to-determine-if-a-promise-is-supported-by-the-browser"> is fully supported in all ever green browsers.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51f45ef4f470" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mmmanyfold/how-to-build-your-own-promise-all-using-when-51f45ef4f470">How to build your own Promise.all using $.when</a> was originally published in <a href="https://medium.com/mmmanyfold">mmmanyfold</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>