<?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 Ivan Goncharov on Medium]]></title>
        <description><![CDATA[Stories by Ivan Goncharov on Medium]]></description>
        <link>https://medium.com/@IvanGoncharov?source=rss-631968eea0fd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*VXnaHa0Qjm_8ZHUKsYX9Hg.jpeg</url>
            <title>Stories by Ivan Goncharov on Medium</title>
            <link>https://medium.com/@IvanGoncharov?source=rss-631968eea0fd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 21:00:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@IvanGoncharov/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[GraphQL Join or how to find all bars around GraphQL Summit with a single query]]></title>
            <link>https://medium.com/apis-guru/graphql-join-or-how-to-find-all-bars-around-graphql-summit-with-a-single-query-e2ebfe27c67c?source=rss-631968eea0fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2ebfe27c67c</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[graphql]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Ivan Goncharov]]></dc:creator>
            <pubDate>Tue, 24 Oct 2017 19:29:26 GMT</pubDate>
            <atom:updated>2017-10-24T19:29:26.351Z</atom:updated>
            <content:encoded><![CDATA[<p>If you visited a couple of developer conferences you should know that the most fun part is not the talks but the bar crawl after the event.</p><p>So how to find all the bars near GraphQL Summit location? A quick and simple answer would be to just copy the address from official website and paste it into Yelp or FourSquare.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ResgMqfvMbFBcZHm89x7Qw.png" /></figure><p>But you don’t need to be a GraphQL guru to do that. How about using GraphQL for getting this data?</p><p>We will do this using the following master plan:</p><ol><li>Get the address of venue. Fortunately, <a href="https://developers.universe.com/docs/graphql-overview">Universe recently released GraphQL API</a> for their catalog of events:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VOp0iQoQLqQ1sFlEp0qbtw.png" /></figure><p>2) Find all bars around this venue. No surprise, here we will just use <a href="https://www.yelp.com/developers/graphiql">Yelp’s GraphQL API</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SXHsHZkxHErNC_Ciab_2sw.png" /></figure><p>Bingo! Problem is solved we get all the necessary data exclusively from GraphQL APIs. But can we reduce it to a single query? What if we could just join two GraphQL APIs together?</p><p>Joining GraphQL APIs is a hot topic at the moment and most likely you have already heard about <a href="https://dev-blog.apollodata.com/graphql-schema-stitching-8af23354ac37">schema stitching</a> concept presented by Apollo. We really like the idea but the complexity of code you have to write looks a bit scary. So we decided to build a new tool from scratch with the idea to join APIs using familiar GraphQL syntax (queries, fragments, IDL) in declarative fashion — GraphQL Join.</p><p>GraphQL Join requires some polishing before the public release but we would like to get feedback about our declarative syntax before. So let’s get familiar with it by stitching Universe and Yelp APIs together in exactly 40 lines:</p><h3>Configuration</h3><p>Everything can be configured inside a single YAML file which has three top level properties apis , joinIDL and transformModule . Let’s describe them one by one:</p><ol><li><strong>apis: Specify APIs to join and how the can be accessed</strong></li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8f043e1f24996429f0d1ed421df0e08b/href">https://medium.com/media/8f043e1f24996429f0d1ed421df0e08b/href</a></iframe><p>GraphQL Join sends introspection query to each of those APIs server to allow reusing remote types in resulting API. We also added support for prefixing types to avoid name clashes if needed (see prefix property). It’s a good idea to prefix types of API you don’t have control over, e.g. we add prefix Yelp_ to all types from Yelp.</p><p>To store access tokens outside of config files and provide them through environment variables we support special construct: ${env: VARIABLE_NAME}</p><p><strong>2) </strong><strong>joinIDL: Describe how to merge two APIs together:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/28192d2796d05c0c5567a975b0a9523a/href">https://medium.com/media/28192d2796d05c0c5567a975b0a9523a/href</a></iframe><p>Does it look familiar? Yes, we used mixture of standard <a href="https://www.graph.cool/docs/faq/graphql-sdl-schema-definition-language-kr84dktnp0/">GraphQL IDL</a>, Query syntax and @export directive (<a href="https://youtu.be/ViXL0YQnioU?t=11m47s">used by Facebook for batching</a>). The only new things we’ve added are @resolveWith and @send directives.</p><p>But let’s go step by step.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/56fe3b2aa7b9cd30b695a90226651367/href">https://medium.com/media/56fe3b2aa7b9cd30b695a90226651367/href</a></iframe><p>Here we decide what will be the root type of our joined API. And we specify Query which is non-prefixed Query type from Universe API (if we wanted to to do the same with Yelp, we should have used Yelp_Query).</p><p>This will effectively copy all the Universe API. Next, let’s extend it with the data from Yelp:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/541a9be3bf19f0c6baf629d50b568592/href">https://medium.com/media/541a9be3bf19f0c6baf629d50b568592/href</a></iframe><p>Here we are adding placesNearby field into Event type. Note that the field return type is Yelp_Businesses.</p><p>New field is resolved by sending getPlacesNearby query to Yelp API with extra arguments provided by LocationForYelp fragment:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7708a9ccf1f4d7dcb100b58961721939/href">https://medium.com/media/7708a9ccf1f4d7dcb100b58961721939/href</a></iframe><p><strong>3) </strong>transformModule<strong>: Transform arguments.</strong> One strange thing you’ve probably noticed is that LocationForYelp exports address and cityName variables but getPlacesNearby query expects those two as a single location argument. Sadly we can’t use our declarative syntax for this transformation and need to write a few lines of JS:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c1c54b6a8144a0095908fcced2b7b5fc/href">https://medium.com/media/c1c54b6a8144a0095908fcced2b7b5fc/href</a></iframe><p>You can see whole join.yaml and join.js files <a href="https://github.com/APIs-guru/graphql-join/tree/master/examples/universe_yelp"><strong>here</strong></a> and start your new join API with a single command:graphql-join ./universe_yelp/join.yaml</p><h4>Try it out</h4><p>Let’s test the resulting API with a query I promised you in the title:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3itZPc9cIXJBDyKCX1EMQw.png" /></figure><p>You can play with this API yourself: <a href="http://universe-yelp.apis.guru/?query=%7B%0A%20%20event(id%3A%20%22X4JR3W%22)%20%7B%0A%20%20%20%20title%0A%20%20%20%20placesNearby(term%3A%20%22beer%22%2C%20radius%3A%20200)%20%7B%0A%20%20%20%20%20%20total%0A%20%20%20%20%20%20business%20%7B%0A%20%20%20%20%20%20%20%20name%0A%20%20%20%20%20%20%20%20rating%0A%20%20%20%20%20%20%20%20location%20%7B%0A%20%20%20%20%20%20%20%20%20%20formatted_address%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D">http://universe-yelp.apis.guru/</a></p><h4>Features</h4><p>Here is the list of what features are already implemented in GraphQL Join:</p><ul><li>Full support of GraphQL queries: aliases, fragments, query variables, etc.</li><li>All request against GraphQL APIs are batched and no special support from your GraphQL server is required.</li><li>Our proxy is absolutely transparent both for the client and the original server. You can even use new joined API to join it with any other API.</li></ul><h4>What’s next</h4><p>For the public release we want to ship it together with a slick UI for creating configuration with blackjack and autocompletion 😀.</p><p>Our main goal is to define declarative syntax for joining GraphQL APIs which is easy to read and has smooth learning curve. Would be great to get your feedback in comments or in person during GraphQL Summit!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2ebfe27c67c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/apis-guru/graphql-join-or-how-to-find-all-bars-around-graphql-summit-with-a-single-query-e2ebfe27c67c">GraphQL Join or how to find all bars around GraphQL Summit with a single query</a> was originally published in <a href="https://medium.com/apis-guru">APIs.guru</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From GraphQL to CSV: the story of API accessibility]]></title>
            <link>https://medium.com/apis-guru/from-graphql-to-csv-6df5e5462793?source=rss-631968eea0fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/6df5e5462793</guid>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[graphql]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Ivan Goncharov]]></dc:creator>
            <pubDate>Wed, 14 Jun 2017 09:48:24 GMT</pubDate>
            <atom:updated>2017-06-14T10:04:29.416Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*daP6kz1ND-PtAiwV0l-lhQ.jpeg" /></figure><p>GraphQL is a hot topic at the moment and it even started appearing in jobs listing. CSV is a totally different story, it hit it’s peak of popularity before the majority of us was even born 😀.</p><blockquote>Something old, something new,</blockquote><p>GraphQL was designed to make life easier for the front-end developers and Facebook engineers have done such a great job that it became more enjoyable than querying SQL directly (especially since you don’t have to do joins anymore). But the result of GraphQL query is always JSON which is fine if you build a website or mobile app but is not so suitable for importing into 3-rd party tools. CSV, on the other hand is de facto standard for analysts, data scientist and everyone who work with spreadsheets.</p><p>Being programmers, <a href="https://medium.com/u/c2c30dfe7345">Roman Hotsiy</a> and I (from <a href="https://apis.guru/">APIs.guru</a>) didn’t experience any of those problems up until we decided to take part in Neo4J <a href="https://dev-blog.apollodata.com/announcing-the-neo4j-graphql-community-graph-hackathon-c9a94f246c7">hackathon</a>:</p><blockquote>We found it very helpful and inspiring to bring the people and activities of the GraphQL Community into one database with a GraphQL-API endpoint.</blockquote><blockquote>It contains tweets, GitHub repositories, Stackoverflow questions and answers, Meetup events and the users and tags related to them.</blockquote><blockquote>Write a (mobile) demo, application, dashboard, visualization, timeline, react component, whatever you want against this backend.</blockquote><p>We found out about the hackathon on Friday at lunch time and on Saturday noon we had to start our journey to GraphQL Europe. So we were on really tied schedule to build something we could publicly release. We brainstormed a few crazy ideas involving Image Recognition and Machine Learning but fell back to the dashboard idea suggested by organizers.</p><p>The first step was to write some queries that provide data for interesting insights in GraphQL community. For example, with all the efforts Facebook put into reference implementation it’s no surprise that JS is quite popular in the community but what about other languages. Bellow is a query that gets the primary language of GitHub repositories mentioning “GraphQL” keyword:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kzSqTt3KHI7SPq03xb4jKg.png" /></figure><p>Next logical step would be to count a number of repositories per language. Would it be great to do it directly inside the query? Something like COUNT function in SQL. Few month ago we had this idea and as result, <a href="https://github.com/APIs-guru/graphql-lodash">GraphQL Lodash</a> was born. It allows to use many filtering, aggregation, etc., functions from the popular Lodash library. Let’s add “countBy” to the query:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U5O2rhpLskw2Q1DmcYeffg.png" /></figure><p>Looks great! And you can test it yourself:</p><h3>APIs.guru 🐝 on Twitter</h3><p>Get insights 💡 into #GraphQL Community data from #neo4j with graphql-lodash: https://t.co/pcdbUhkY2V More interesting queries are coming! 🙌</p><p>But how to visualize this data? Here we are out of our comfort zone. We specialize on tooling around APIs and don’t have much experience with visualization libraries like D3. So we decided to do it hackathon style and use Google Spreadsheets as a dashboard. We wanted our graphs to update based on the latest data since it can’t be called “dashboard” otherwise :) So we needed to figure out a way how to query data from within a spreadsheet.</p><p>GraphQL queries are usually sent as HTTP POST, however, the majority of servers also support HTTP GET with query specified inside URL. So if you click on <a href="http://graphql-community.apis.guru/graphql?raw=true&amp;query=%7B%0A%20%20Repository%20%40_(countBy%3A%20%22language%22)%20%7B%0A%20%20%20%20language%0A%20%20%7D%0A%7D%0A">this link</a> you will see the resulting JSON.</p><p>The title of this article suggests that Google Spreadsheet doesn’t allow importing data from JSON and only supports XML, HTML, and CSV. And what can be simpler that CSV? You just stringify values and join them with commas. We used a little bit of Lodash dark magic and got this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KdArwWtSYxBhHYFUwsVttg.png" /></figure><p>The result looks strange, it’s actually JSON object with a single <em>data </em>property that contains CSV as a value. This is a standard wrapper for all GraphQL responses and the last barrier for us. So we decided to use brute force and set up a proxy that would remove it. On the screenshot above you can see “Unwrap Data” checkbox which adds &amp;unwrap=true to “Data Link” URL. After all those manipulations we received <a href="http://graphql-community.apis.guru/graphql?raw=true&amp;unwrap=true&amp;query=query%20%40_(get%3A%20%22Repository%22)%20%7B%0A%20%20Repository%20%40_(%0A%20%20%20%20countBy%3A%20%22language%22%0A%20%20%20%20toPairs%3A%20none%0A%20%20%20%20each%3A%20%7B%0A%20%20%20%20%20%20join%3A%20%22%2C%22%0A%20%20%20%20%7D%0A%20%20%20%20join%3A%20%22%5Cn%22%0A%20%20)%20%7B%0A%20%20%20%20language%0A%20%20%7D%0A%7D%0A">url that points to CSV</a> directly! 🎉</p><p>Rest of the project was really straightforward: we used <a href="https://support.google.com/docs/answer/3093335?hl=en">IMPORTDATA</a> function to import CSV into a spreadsheet and a few additional clicks got us a nice chart:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6Ny3_40Uy9Wwmsffb9uOmg.png" /></figure><p>Repeating this process with a few more queries and our hackathon submission was done:</p><h3>APIs.guru 🐝 on Twitter</h3><p>Our submission for #neo4j hackathon. #GraphQL ➡️ CSV ➡️ Spreadsheets = Live Dashboard 📊📈📉 More charts are comming... https://t.co/rquJDj69Ju</p><p>It was really great to hear <a href="http://twitter.com/lyonwj">@lyonwj</a> from Neo4j giving a shout about our project from the stage of GraphQL Europe. Moreover, as the prize, we got nice T-shirts and two pairs of AirPods.</p><h4>Takeaway</h4><p>A real lesson I got from this hackathon is:</p><blockquote>“API accessibility” is important</blockquote><p>For something as simple as making report writing code is overkill. And having URL to CSV file is what allows anyone dig into the data without any coding. Our hackathon project is just a proof of concept we built in less than a day. To provide a real solution we have to figure out how to replace Lodash dark magic with something more intuitive.</p><p><strong><em>We need your feedback</em></strong><em>.</em> Is GraphQL to CSV proxy something that can help you with everyday tasks?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6df5e5462793" width="1" height="1" alt=""><hr><p><a href="https://medium.com/apis-guru/from-graphql-to-csv-6df5e5462793">From GraphQL to CSV: the story of API accessibility</a> was originally published in <a href="https://medium.com/apis-guru">APIs.guru</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[API Discovery: Can we do better?]]></title>
            <link>https://medium.com/apis-guru/api-discovery-can-we-do-better-2336706d5407?source=rss-631968eea0fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/2336706d5407</guid>
            <category><![CDATA[seo]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[rest]]></category>
            <dc:creator><![CDATA[Ivan Goncharov]]></dc:creator>
            <pubDate>Mon, 21 Nov 2016 12:08:03 GMT</pubDate>
            <atom:updated>2016-11-21T15:01:21.396Z</atom:updated>
            <content:encoded><![CDATA[<p>Do you remember the last time you searched for a suitable Web API? To put this into context, let’s assume you want to send emails to your users. As always, you start by typing “Email API” in Google and this is what you see:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*2uAx667FtGUuBUiFT99HYw.png" /></figure><p>As usual Google gives you lots of relevant search results and you start opening every site one by one. You skip typical marketing info on the front page and go straight to the “Prices” page. Then you automatically assume it’s a REST API using JSON payloads. Who’s doing anything else nowadays? Next, you proceed to answer the more interesting questions: do they have an SDK for the language you use? Do they have an API console? How is authentication handled?</p><p>You repeat the entire process all over again with the next contestant and in an hour or so you end up with bunch of open tabs and no clear understanding of which API has the best quality/price ratio. So you continue by looking for reviews on StackOverflow, Quora and reading a bunch of “10 Best Email APIs” articles.</p><p>Can it be better? Let’s skip a few hours. You have already made your choice and even done some initial integration. So after hours of continuous googling and going through endless webpages you want to treat yourself with Mexican food:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*OQocLjfU0JgZvR1__-np8w.png" /></figure><p>Surprise! This time Google goes beyond simple text results and presents you with a special panel with lots of useful info. You can even filter restaurants by rating and working hours. Moreover, you can read reviews right there.</p><p>But why does searching for APIs and restaurants differ so much? If you think Google is using some fancy machine-learning algorithms to extract this data, just go to a restaurant’s website and open Developer Tools:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*Dj0gm8sEyedEwKH1bWMKgg.png" /></figure><p>As you can see, there is no magic here. All data is taken directly from plain old JSON wrapped in HTML. But if it’s just a matter of adding some JSON to a website why can’t API owners do the same? API owners probably know JSON better than restaurant owners 😄</p><p>Here is where everything gets trickier. For Google to understand this data it should conform to one of the predefined types from <a href="http://schema.org/">schema.org</a>. It has dedicated types for almost everything including <a href="http://schema.org/Zoo">Zoos</a>, <a href="http://schema.org/TattooParlor">TattooParlors</a> and even <a href="http://schema.org/Volcano">Volcanoes</a> but it lacks anything suitable for describing APIs.</p><p>To fix this I have opened an issue on the official schema.org repository to add a new “WebAPI” type. One of the maintainers asked a reasonable question which I’m too biased to answer:</p><blockquote>I can see the basic need for something like this — I would like to see some indication of who would apply it to their sites (other than yourself of course).</blockquote><p>We want to hear your voice!</p><p><strong>Will it make your life easier? </strong>React with 👍 on <a href="https://github.com/schemaorg/schemaorg/issues/1423">the GitHub issue</a> (<em>please don’t spam with ‘+1’ comments</em>). You are welcome to share your thoughts in a comment on this post.</p><p><strong>Are you an API owner and would like to describe your API like this? </strong>Please leave a comment in <a href="https://github.com/schemaorg/schemaorg/issues/1423">the GitHub issue</a>.</p><p><em>We understand that adding such a type to schema.org doesn’t guarantee that Google or any other search engine will adopt it immediately. This is just first step in that direction.</em></p><p>As a bonus, we have prepared a small teaser for you. Here is how enhanced search results for APIs could look like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*zdnIzSr2U2_6MLEEIqsXmA.png" /></figure><p><strong><em>Disclaimer</em></strong><em>: The picture is 100% a product of my and </em><a href="https://medium.com/u/c2c30dfe7345"><em>Roman Hotsiy</em></a><em>’s imagination and was sketched using Chrome Developer Tools in 20 minutes. We are not Google’s employees (however we wouldn’t mind </em>😄<em>)</em></p><p>P.S. This article oversimplifies a lot of things. If you want to learn more about JSON-LD and Linked Data in general we recommend you start by watching <a href="https://www.youtube.com/watch?v=vioCbTo3C-4">this video</a>.</p><p><strong>Update</strong>: based on the feedback I feel like I need to explain my motivation behind pushing this feature to <a href="http://schema.org/">schema.org</a>. For last two years, I am a maintainer of <a href="https://apis.guru/">API catalog</a>. But the hard truth I learned during these years is that API catalogs/lists don’t scale well and keeping it up to date takes a lot of manual work. On the other side, SEO should be big motivation for API owners to add/update metadata for their APIs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2336706d5407" width="1" height="1" alt=""><hr><p><a href="https://medium.com/apis-guru/api-discovery-can-we-do-better-2336706d5407">API Discovery: Can we do better?</a> was originally published in <a href="https://medium.com/apis-guru">APIs.guru</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>