<?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>Forem: Lucia Cerchie</title>
    <description>The latest articles on Forem by Lucia Cerchie (@cerchie).</description>
    <link>https://forem.com/cerchie</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%2F502742%2Fd34ca8d0-5472-425e-b287-3c8b706735cf.png</url>
      <title>Forem: Lucia Cerchie</title>
      <link>https://forem.com/cerchie</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/cerchie"/>
    <language>en</language>
    <item>
      <title>Beyond the Basics: Windowing in Apache Kafka</title>
      <dc:creator>Lucia Cerchie</dc:creator>
      <pubDate>Fri, 24 Feb 2023 20:02:41 +0000</pubDate>
      <link>https://forem.com/cerchie/beyond-the-basics-windowing-in-apache-kafka-3phc</link>
      <guid>https://forem.com/cerchie/beyond-the-basics-windowing-in-apache-kafka-3phc</guid>
      <description>&lt;h2&gt;
  
  
  What Is Windowing?
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;This post was originally published on the &lt;a href="https://www.confluent.io/blog/windowing-in-kafka-streams/"&gt;Confluent blog&lt;/a&gt;.&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;If you’re creating an application with Kafka Streams or ksqlDB, and that application involves aggregations, it’s likely that you’ll use windowing. &lt;/p&gt;

&lt;h2&gt;
  
  
  Why is that?
&lt;/h2&gt;

&lt;p&gt;Well, aggregations of data accumulate over time, and without a limit, these aggregations won’t stop accumulating. Enter windowing, which defines the amount of data that can accumulate. &lt;/p&gt;

&lt;p&gt;Note that windowing takes four forms, depending on whether the window is defined by size and period, or whether the window is event-triggered.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--U6LQnTkp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qoc7d12x1uhcvaoip9jz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--U6LQnTkp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qoc7d12x1uhcvaoip9jz.png" alt="table with 'hopping' and 'tumbling' under 'Size and Period' and 'session' and 'sliding' under 'Event triggered'" width="880" height="249"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For example, say that you’re designing an application using moisture sensors to alert when a houseplant gets too dry. You can perform a filter for plants with low moisture readings in the past hour. If that filter returns anything, that event can trigger an aggregation over a window tumbling on every hour. The result is written to the alerts. &lt;/p&gt;

&lt;p&gt;Let’s take a look at each of the types of windowing in finer detail. &lt;/p&gt;

&lt;h2&gt;
  
  
  Hopping
&lt;/h2&gt;

&lt;p&gt;What is a hopping window?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2MYwKgSr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8lnchl1yk46elbnpsgx9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2MYwKgSr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8lnchl1yk46elbnpsgx9.png" alt="graph of a hopping window" width="880" height="295"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A hopping window is bound by time and defined by a window size and the size of the time block at which it advances (both measured in seconds).&lt;/p&gt;

&lt;p&gt;Consider the red window in the above diagram and think about it advancing through time: if you had a window size of 50 seconds but an advance size of 15 seconds, there would be an overlap of 35 seconds between the windows. In a hopping window, the window size is usually set to a larger amount of time than the advance size. The above diagram shows what an overlap might look like if you took the window as a rectangle and superimposed it over a wavy stream of data—the rectangles that overlap represent the overlapping window.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: Tumbling windows never overlap or have gaps. Hopping windows might have gaps or overlaps, or they might not. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A classic example of a hopping window implementation is a dashboard with moving averages—say, average clicks on a certain e-commerce page, like a product details page for an air fryer, for 2-minute windows in the past 24 hours. &lt;/p&gt;

&lt;h2&gt;
  
  
  Creating a hopping window
&lt;/h2&gt;

&lt;p&gt;As stated above, there are two key pieces of information you need to configure hopping windows: window size and advance size. &lt;/p&gt;

&lt;p&gt;When you’re working with Kafka Streams, you need to set both a windowSize and advanceSize. See the more complete example in this Kafka Streams 101 tutorial. &lt;/p&gt;

&lt;p&gt;If you’re implementing a hopping window with ksqlDB, then you need to make sure to create a table using the WINDOW HOPPING syntax. You’ll set the two sizes with SIZE and ADVANCE BY. You can view a more complete example in &lt;a href="https://rebrand.ly/zgyi1vw"&gt;this tutorial&lt;/a&gt;. &lt;/p&gt;

&lt;h2&gt;
  
  
  Tumbling
&lt;/h2&gt;

&lt;p&gt;What is a tumbling window?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--p2ZZCnKw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zesucevbjfq0oenvdbsq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--p2ZZCnKw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zesucevbjfq0oenvdbsq.png" alt="diagram of tumbling window" width="880" height="282"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Similar to hopping windows, tumbling windows are also time-based. In fact, a tumbling window is a special subtype of hopping window where windowSize and advanceSize are the same. This means an individual event will only ever be present in one tumbling window––no duplicates. As you can see, this diagram differs from the former in that the rectangles do not overlap, representing the non-overlapping windows. &lt;/p&gt;

&lt;p&gt;Tumbling windows are useful for reporting where you want events to belong to a single window, like taking the aggregate of credit card swipes in the last 55 seconds. &lt;/p&gt;

&lt;h2&gt;
  
  
  Creating a tumbling window
&lt;/h2&gt;

&lt;p&gt;Creating a tumbling window in Kafka Streams uses the same process as a hopping window, but you need to make sure that windowSize and advanceSize are the same. &lt;/p&gt;

&lt;p&gt;In ksqlDB, you use the WINDOW TUMBLING syntax on a TABLE and set the SIZE. The tutorials section on the Confluent website houses a full example: &lt;a href="https://rebrand.ly/xpnkk7t"&gt;How to create tumbling windows.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Session&lt;/p&gt;

&lt;p&gt;What is a session window?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZomF8vjl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q62e8g4t1kr0km9hlcxl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZomF8vjl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q62e8g4t1kr0km9hlcxl.png" alt="diagram of session window" width="880" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A session window is triggered by events. The mechanism involves something called an “inactivity gap.” This gap is the amount of time within which the window will grow unless interrupted by a new event. When a new event flows in as input, the inactivity window resets and the window continues to grow. If your inactivity window is too short or you have lots of events, this can result in a very long window! &lt;/p&gt;

&lt;p&gt;In the above diagram, the inactivity gaps are represented by blue rectangles, separated by an event which is represented by a star. The rectangle representing the session window spans the inactivity gaps. &lt;/p&gt;

&lt;p&gt;Use cases involve tracking user activity if you wanted to know how many events were generated over a period of time (e.g., how long exactly was the user’s FlixMovie binge?). &lt;/p&gt;

&lt;h2&gt;
  
  
  Creating a session window
&lt;/h2&gt;

&lt;p&gt;Creating a session window in Kafka Streams involves setting an inactivityGap. You can see a more complete description in this tutorial: Windowing. &lt;/p&gt;

&lt;p&gt;The other option is to use ksqlDB, employing a table with a WINDOW SESSION syntax. You can view a tutorial on this here: &lt;a href="https://rebrand.ly/49p0fuj"&gt;Create session windows&lt;/a&gt;. &lt;/p&gt;

&lt;h2&gt;
  
  
  Sliding
&lt;/h2&gt;

&lt;p&gt;What is a sliding window?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_KnxF5Rv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1cl18xuyueygl69j21vo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_KnxF5Rv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1cl18xuyueygl69j21vo.png" alt="diagram of sliding window" width="880" height="598"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A sliding window is also time-based, so the size of the window is defined in seconds. In order for a sliding window to be triggered, some user events must happen within a defined window of time. For example, you might use this type of window if you wanted to calculate the data between “add-to-cart” and “purchase” events from users that were made within the defined amount of time of three hours. &lt;/p&gt;

&lt;p&gt;In the diagram above, the defined amount of time is represented by a large light-blue rectangle. The user events are represented by two gold stars, and the purple rectangle between them represents the data window. &lt;/p&gt;

&lt;h2&gt;
  
  
  Creating a sliding window
&lt;/h2&gt;

&lt;p&gt;When you create a sliding window in the Streams API, you need to set timeDifference. You can find a more complete example in &lt;a href="https://rebrand.ly/mcb1pqh"&gt;this windowing tutorial&lt;/a&gt; on Confluent Developer. &lt;/p&gt;

&lt;p&gt;Support for explicitly setting sliding windows is not yet available in ksqlDB. &lt;/p&gt;

&lt;h2&gt;
  
  
  A note on late events
&lt;/h2&gt;

&lt;p&gt;What if your events arrive late? It could skew your analysis; therefore, you can introduce “grace periods” in tumbling, hopping, and sliding windows. It’s basically a set amount of time in which events will be caught by the window, even though the time stamps of those events are greater than the window’s end. Note that events that occur after the grace period won’t be included—those are late for good and will be missed. Session windows don’t have grace periods because they are based on user behavior only, rather than time. &lt;/p&gt;

&lt;p&gt;Since KIP-633, there is no default grace period for Kafka Streams. However, in ksqlDB, the default is 24 hours. &lt;/p&gt;

&lt;h2&gt;
  
  
  Where to go from here
&lt;/h2&gt;

&lt;p&gt;If you found this introduction to windowing with Apache Kafka® useful, you may also be interested in this list of resources for a deeper dive:&lt;/p&gt;

&lt;p&gt;A Kafka Stream video from the Kafka Streams 101 course: &lt;a href="https://rebrand.ly/3w5nwb2"&gt;Windowing&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Kafka Streams Application &lt;a href="https://rebrand.ly/rwwv10f"&gt;tutorial &lt;/a&gt;&lt;/p&gt;

&lt;p&gt;ksqlDB 101 &lt;a href="https://rebrand.ly/zgyi1vw"&gt;course&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Streams tutorials &lt;a href="https://rebrand.ly/nkd7al2"&gt;list&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;See the &lt;a href="https://rebrand.ly/q06xoxn"&gt;Event Aggregator pattern&lt;/a&gt;&lt;/p&gt;

</description>
      <category>database</category>
      <category>tooling</category>
      <category>apachekafka</category>
      <category>kafka</category>
    </item>
    <item>
      <title>A Framework For Knowing What You Don't Know</title>
      <dc:creator>Lucia Cerchie</dc:creator>
      <pubDate>Fri, 16 Dec 2022 21:07:50 +0000</pubDate>
      <link>https://forem.com/cerchie/a-framework-for-knowing-what-you-dont-know-1m2d</link>
      <guid>https://forem.com/cerchie/a-framework-for-knowing-what-you-dont-know-1m2d</guid>
      <description>&lt;p&gt;&lt;em&gt;This blog post was originally posted on &lt;a href="https://luciacerchie.dev/blog/a-framework-for-knowing-what-you-dont-know/" rel="noopener noreferrer"&gt;my website&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Over my career I've had to learn new things many, many times. I've been an elementary school teacher, a digital marketer, a software engineer, and now I'm a full-time developer advocate. Over and over again, I've had to learn completely new concepts. It's great; it keeps me humble, it keeps me happy. There's a lot of dopamine involved in learning. But one of the most difficult parts of learning is &lt;em&gt;knowing what you don't know&lt;/em&gt;. And knowing what you don't know is important, because it keeps you from making the types of mistakes that emanate from errors in judgment.&lt;/p&gt;

&lt;p&gt;I've learned a couple of things about defining the limits of my knowledge about a concept. I'm sharing my framework here in case it's helpful to anyone else in tech.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stage 1: Nothing
&lt;/h2&gt;

&lt;p&gt;The first stage of getting to know a new concept is the easiest to define. I'm starting from nothing!&lt;/p&gt;

&lt;p&gt;This is great. I know exactly what I don't know. Let's say I'm completely brand-spanking new to the concept of an API. Here is a diagram of what I don't know about APIs:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fleuub9xr1cj2rluv49x5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fleuub9xr1cj2rluv49x5.png" alt="image of my brain, outside of a circle labeled 'everything about APIs'"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It doesn't get more accurate than that. I'm not kidding. "What you don't know" will surprise you again, and again, and again. The framework I'm suggesting here will not save you from being wrong in front of people. But I think it will give you some general guidance on how to approach learning new things.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stage 2: One Instance of a Concept
&lt;/h2&gt;

&lt;p&gt;So let's consider universal concepts. Definitions that we all agree on. For example, an API &lt;a href="https://en.wikipedia.org/wiki/API" rel="noopener noreferrer"&gt;according to Wikipedia&lt;/a&gt; is&lt;/p&gt;

&lt;p&gt;"An application programming interface (API) is a way for two or more computer programs to communicate with each other."&lt;/p&gt;

&lt;p&gt;Maybe that's not the most complete definition, but I think most techies would agree on what's there. Now, you can memorize this definition, but you won't have experiential knowledge of an API until you've met one out in the wild.&lt;/p&gt;

&lt;p&gt;Let's say I'm at that stage. I'm getting used to querying a REST API, and I'm learning to build one myself with Python or Node Express or something. This definition applies to the REST API I'm building, so I'm gaining experience with one type of API. One particular instance of this universal concept. Here is another map of my brain:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9tqbvejouzkj0wycq1xo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9tqbvejouzkj0wycq1xo.png" alt="circle with my brain in it, just touching of two intersecting circles labeled 'everything about APIs' and 'everything about REST APIs'. An arrow points to the intersection of those two circles"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, I'm learning something about REST APIs. And that's it for now. The arrow is pointing to a boundary that I'm not aware of:&lt;/p&gt;

&lt;p&gt;I don't know what's common to REST APIs and all APIs, and what's different.&lt;/p&gt;

&lt;p&gt;So, I've seen one particular instance, but I've not seen another instance of an API. And this is a problem because there are different kinds of APIs underneath the universal concept of "API". Like there are different kinds, or species, of cats underneath the "cat" genus. And tigers are very different from lions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stage 3: Two instances, of different kinds, of a concept.
&lt;/h2&gt;

&lt;p&gt;Say I start implementing not a REST API, but a GraphQL API. It's a different kind of API from a REST API, like lions are a different kind of cat from tigers. My worldview on APIs begins to break down. It's destroyed by differences between REST APIs and GraphQL APIs, like&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  GraphQL is an application layer, while REST is a style of API. Not every API is in the REST style!&lt;/li&gt;
&lt;li&gt;  GraphQL requests are JSONesque, while REST requests are often parameterized in URLs. Not every API uses parameters the same way! Or has the same request format.&lt;/li&gt;
&lt;li&gt;  You define GraphQL with a schema, rather than a list of endpoints. Not every API is defined the same way!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsa5hwkrsnxcawd3w4cyk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsa5hwkrsnxcawd3w4cyk.png" alt="circle with my brain in it, just touching of three intersecting circles labeled 'everything about APIs' and 'everything about REST APIs' and 'everything about GraphQL APIs'."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I know that diagram just got complicated, I'm sorry. But this is the most important stage to take notes at. Why? Because when you realize what assumptions you've made, you realize what questions to ask the next time you encounter a new kind of API.&lt;/p&gt;

&lt;p&gt;These are the assumptions I've made:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  All APIs are in the same style.&lt;/li&gt;
&lt;li&gt;  All API requests are formatted alike.&lt;/li&gt;
&lt;li&gt;  You define APIs in the same way.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now that those assumptions have been broken by my experience, I know what questions to ask next time I'm learning a new kind of API.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stage 4: The third instance of a different kind.
&lt;/h2&gt;

&lt;p&gt;Ok, say I'm learning what a tRPC API is in order to implement on at work or something. Based on the kinds of assumptions I made last time, what might I ask now?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  How does the style of tRPC compare to REST and GraphQL, the ones I'm familiar with?&lt;/li&gt;
&lt;li&gt;  How are tRPC requests formatted?&lt;/li&gt;
&lt;li&gt;  How do I map or define a tRPC API?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These questions will help me understand what a tRPC API is much faster than I understood what a REST or GraphQL API is.&lt;/p&gt;

&lt;p&gt;Furthermore, I'll be understanding the general concept of an API even better, because I'll be understanding what is in common between all these kinds of APIs. I'll also be understanding GraphQL and REST APIs better at this stage, because I can then make lists of their limitations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Generalizing this process
&lt;/h2&gt;

&lt;p&gt;I think every time you learn something new, you have to go through these 4 stages and there's not really a way around that.&lt;/p&gt;

&lt;p&gt;But if you do it consciously, it speeds up the process of learning.&lt;/p&gt;

&lt;p&gt;So when you're beginning, acknowledging "I know nothing about this. I should ask someone who knows something about this what is the best instance to build first," can save you some pain.&lt;/p&gt;

&lt;p&gt;Then again, once you've built your first instance, acknowledging "I might be making assumptions here that don't apply to other instances. I should ask someone who has built other kinds of instances what the differences are," will help you make decisions about whether to learn a new paradigm when you're building your next instance.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>productivity</category>
      <category>career</category>
      <category>devrel</category>
    </item>
    <item>
      <title>What Are Apache KafkaⓇ Consumer Group IDs?</title>
      <dc:creator>Lucia Cerchie</dc:creator>
      <pubDate>Tue, 13 Dec 2022 15:32:16 +0000</pubDate>
      <link>https://forem.com/confluentinc/what-are-apache-kafka-consumer-group-ids-3di5</link>
      <guid>https://forem.com/confluentinc/what-are-apache-kafka-consumer-group-ids-3di5</guid>
      <description>&lt;p&gt;&lt;em&gt;This post was originally published on the &lt;a href="https://www.confluent.io/blog/configuring-apache-kafka-consumer-group-ids/?utm_source%5B%E2%80%A6%5Dx_ch.bp_what-are-apache-kafka-group-ids_content.apache-kafka"&gt;Confluent blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Consumer Group IDs are a vital part of consumer configuration in Apache Kafka®. Setting the consumer Group ID determines what group a consumer belongs to, which has some major consequences. There are three areas in which Group IDs are particularly pertinent:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Detecting new data&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Work sharing&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Fault tolerance&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let’s dive in. &lt;/p&gt;

&lt;h2&gt;
  
  
  What is a Kafka consumer?
&lt;/h2&gt;

&lt;p&gt;Kafka consumers read/consume data from Kafka producers, do the work of reading event streams. They read events, or messages, from logs called topics. Topics are further split into partitions, which are append-only logs that store the messages. This enables each topic to be hosted and replicated across a number of brokers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--D0UnlcZc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xi5dabvw57s8ueb6luao.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--D0UnlcZc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xi5dabvw57s8ueb6luao.png" alt="Consumer, represented by a pink rectangle, consuming partitions, represented by purple rectangles." width="880" height="371"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see in the diagram, a given consumer in a consumer group can read from multiple partitions, including multiple partitions housed in the same topic. &lt;/p&gt;

&lt;h2&gt;
  
  
  Using consumer Group IDs to detect new data
&lt;/h2&gt;

&lt;p&gt;Group IDs are associated through the broker with bits of information called offsets, which specify the location of a given event within a partition, and as such, represent progress through the topic. Offsets in consumer groups serve the same purpose as how bookmarks or sticky tabs function in books. You can learn more about offsets in our FAQ. &lt;/p&gt;

&lt;h2&gt;
  
  
  Checking for new data
&lt;/h2&gt;

&lt;p&gt;You can use a particular Group ID’s offset to check whether there’s been new data written to the partition.  If there’s an event with a larger offset, that means there’s new data to read. If you want to know how to read the offset, here’s a command using the kafka-consumer-groups utility that will read your offsets:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kafka-consumer-groups &lt;span class="nt"&gt;--bootstrap-server&lt;/span&gt; localhost:9092 &lt;span class="nt"&gt;--describe&lt;/span&gt; &lt;span class="nt"&gt;--group&lt;/span&gt; group1 &lt;span class="nt"&gt;--offsets&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note that you need to provide a valid Group ID to --group if you’re trying out this command. The output will resemble the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="nv"&gt;`GROUP   TOPIC  PARTITION  CURRENT-OFFSET  LOG-END-OFFSET  LAG     OWNER
Groupname topicname     0        2               2         1       ownername
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or, if you want to learn more about how to do this with the Confluent CLI for a topic hosted in Confluent Cloud, you can check out this tutorial on reading from a specific offset and partition. &lt;/p&gt;

&lt;p&gt;There’s more on the &lt;code&gt;kafka-consumer-groups&lt;/code&gt; utility in our documentation, and you can always run &lt;code&gt;kafka-consumer-groups—help&lt;/code&gt; for a full list of the options. &lt;/p&gt;

&lt;h2&gt;
  
  
  Consumer Group IDs in work sharing
&lt;/h2&gt;

&lt;p&gt;The Group ID determines which consumers belong to which group. You can assign Group IDs via configuration when you create the consumer client. If there are four consumers with the same Group ID assigned to the same topic, they will all share the work of reading from the same topic.  &lt;/p&gt;

&lt;p&gt;If there are eight partitions, each of those four consumers will be assigned two partitions. What if there are nine partitions? That means the leftover partition will be assigned to the first consumer in the group so that one consumer reads from three partitions and the rest of the consumers read from two partitions. It’s the broker’s job to continually ensure that partitions are evenly distributed among the connected consumers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4BNHRPQy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y8v7o0jzu7ylgrqo019o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4BNHRPQy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y8v7o0jzu7ylgrqo019o.png" alt="Consumers, represented by a pink rectanglea, consuming partitions, represented by purple rectangles. 4 consumers consume 8 partitions by taking 2 each, 4 consumers consume 9 partitions by taking 2, 2, 2, and 3. The top diagram represents an anomaly and is described in a note." width="880" height="852"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: At the top, you'll see that although there are four consumers, three are idle. That's because only one consumer in the same group can read from a single partition.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This whole process is predicated on the presence of a Group ID to unify the consumers. It’s important to remember this while you’re setting up your consumers. &lt;/p&gt;

&lt;p&gt;If you’re connecting microservices, you want to make sure that each service has its own consumer group (and hence its own Group ID). Why is that? Let’s walk through an example.&lt;/p&gt;

&lt;p&gt;Let’s say there’s a topic “payments,” and both the “orders” microservice and the “refunds” microservice will need to read from that topic. You wouldn’t want them to share the same offsets, because if they did, the progress through the “payments” topic would be shared by “orders” and “refunds,” which would mean potential missed orders or refunds. &lt;/p&gt;

&lt;p&gt;However, if you had a group of consumers handling “orders” by reading from partitions in the “payments” topic, then the current offset for each consumer in the group, stored in the broker, is vital to ensure continuous progress in case a consumer in the group crashes. At the same time, if consumers from another, separate group, like “refunds” are reading from the “payments” topic, they can continue their progress unaffected even if the consumers in the “orders” group are rebalancing. &lt;/p&gt;

&lt;h2&gt;
  
  
  The role of consumer Group IDs in fault tolerance
&lt;/h2&gt;

&lt;p&gt;As the last example revealed, Group IDs also play a vital role in fault tolerance. &lt;/p&gt;

&lt;h3&gt;
  
  
  What happens when a consumer crashes?
&lt;/h3&gt;

&lt;p&gt;Each consumer group’s broker sends “heartbeat requests” to the consumers at a set interval. If a consumer does not respond in time, a rebalance is triggered. &lt;/p&gt;

&lt;h3&gt;
  
  
  How does a Group ID play into rebalancing?
&lt;/h3&gt;

&lt;p&gt;Well, in either case, the broker’s record of the associated offset determines where the consumer will begin reading after a rejoin. As long as the Group ID remains the same, it can pick up exactly where it left off, without any risk of data loss. &lt;/p&gt;

&lt;p&gt;If you’re interested in learning more about rebalancing, we recommend the blog post Incremental Cooperative Rebalancing in Apache Kafka: Why Stop the World When You Can Change It?. You can also consult our FAQ. &lt;/p&gt;

&lt;h2&gt;
  
  
  Where to go from here
&lt;/h2&gt;

&lt;p&gt;In summary, when you set a consumer Group ID in the process of creating a consumer client, that Group ID assigns the consumer to its group, which has ramifications for work sharing, detecting new data, and data recovery. &lt;/p&gt;

&lt;p&gt;To learn more about this and other topics, check out these recommended resources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Confluent Developer: Learn Apache Kafka through &lt;a href="https://developer.confluent.io/"&gt;Confluent Developer&lt;/a&gt; tutorials, documentation, courses, blog posts, and examples. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Confluent Community: If you have a question about Apache Kafka or you’d like to meet other Kafka developers, head over to &lt;a href="https://www.confluent.io/community/"&gt;Confluent Community&lt;/a&gt; and introduce yourself on our Community Slack or Forum. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Streaming Audio Podcast: Listen to the &lt;a href="https://developer.confluent.io/podcast/"&gt;Streaming Audio Podcast&lt;/a&gt; to hear lively conversations with Confluent users about the ins and outs of Apache Kafka. The episode Optimizing Kafka’s Internals covers consumer group internals. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>apachekafka</category>
      <category>programming</category>
      <category>todayilearned</category>
      <category>database</category>
    </item>
    <item>
      <title>Three Things I've Learned About Writing Abstracts</title>
      <dc:creator>Lucia Cerchie</dc:creator>
      <pubDate>Wed, 16 Nov 2022 16:03:43 +0000</pubDate>
      <link>https://forem.com/cerchie/three-things-ive-learned-about-writing-abstracts-196</link>
      <guid>https://forem.com/cerchie/three-things-ive-learned-about-writing-abstracts-196</guid>
      <description>&lt;p&gt;Recently I've joined the developer advocate team at Confluent, which is full of highly experienced speakers who have mentored me as I craft abstracts.&lt;/p&gt;

&lt;p&gt;I'll be honest; when I began writing abstracts I thought, "How hard can this be? I've written plenty of blog posts, technical articles, and the occasional haiku. Abstracts will come naturally."&lt;/p&gt;

&lt;p&gt;Reader, they did not! The art of writing and fine-tuning abstracts is challenging, but learn-able. Luckily, I've gained a lot of knowledge from my teammates and now I feel a lot more comfortable with writing abstracts. I wrote this post to hand on a few of the things I've learned.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Connect with your audience in the first sentence.​
&lt;/h2&gt;

&lt;p&gt;Let's start with this abstract that I've written up for the purpose of this blog post:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Come to my talk about choosing React frameworks. We'll learn how and why to choose the framework that suits your web development needs. You'll learn criteria for choosing a web development framework and how to apply them. By the end of my talk, you'll know more about the React ecosystem and have the tools to get the job done."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The first sentence, "Come to my talk about choosing React frameworks," is a nice invitation but it doesn't really hook the reader. In order to connect with the audience, it's a good idea to start by mentioning their pain point. In this example, a good first few sentences might be more like the following:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"The number of React frameworks in recent years has reached an overwhelming height. Social media debates run fierce. There's only one consensus: choosing the right framework for the job is of paramount importance. But how, exactly, do we pick a framework?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  2. Position your pronouns thoughtfully.​
&lt;/h2&gt;

&lt;p&gt;Take a look at the abstract once more.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"The number of React frameworks in recent years has reached an overwhelming height. Social media debates run fierce. There's only one consensus: choosing the right framework for the job is of paramount importance. But how, exactly, do we pick a framework? We'll learn how and why to choose the framework that suits your web development needs. You'll learn criteria for choosing a web development framework and how to apply them. By the end of my talk, you'll know more about the React ecosystem and have the tools to get the job done."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There's "we", "you", and "my" here. Consistency is key in all writing, but for talks, you might choose "we" over other options to reflect a sense of camaraderie with the audience.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Let your solution for the audience's pain point be clear.​
&lt;/h2&gt;

&lt;p&gt;Currently, the solution that the speaker offers is vague:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"We'll learn how and why to choose the framework that suits your web development needs. We'll learn criteria for choosing a web development framework and how to apply them. By the end of the talk, we'll know more about the React ecosystem and have the tools to get the job done."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In fact, all you can really tell is that the speaker is offering some kind of solution. There are no hints as to what it might be.&lt;/p&gt;

&lt;p&gt;Here's a better way to express the speaker's intention:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"We'll distill the criteria for selecting a React framework into three crucial questions. Then, we'll walk through a few use cases together to garner some experience making these decisions. What does the decision making process look like for building static portfolio sites, large e-commerce sites, and mobile game apps? By the end, we'll feel ready to critically appraise React frameworks, familiar or unfamiliar, for our own projects."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This gives some detail ("three crucial questions", and the use cases) without giving everything away. It also communicates the value to the audience: a confidence in their choice of framework.&lt;/p&gt;

&lt;p&gt;Now the whole abstract reads:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"The number of React frameworks in recent years has reached an overwhelming height. Social media debates run fierce. There's only one consensus: choosing the right framework for the job is of paramount importance. But how, exactly, do we pick a framework?&lt;/p&gt;

&lt;p&gt;We'll distill the criteria for selecting a React framework into three fundamental questions. Then, we'll walk through a few real-life use cases together to garner some experience making these decisions. What does the decision making process look like for building static portfolio sites, large e-commerce sites, and mobile game apps?&lt;/p&gt;

&lt;p&gt;By the end, we'll feel ready to critically appraise React frameworks, familiar or unfamiliar, for our own projects."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I think this version sounds a lot more interesting and clear, don't you?&lt;/p&gt;

</description>
      <category>devrel</category>
      <category>beginners</category>
      <category>career</category>
      <category>writing</category>
    </item>
    <item>
      <title>What does 'batching' mean when we're talking about Apache KafkaⓇ?</title>
      <dc:creator>Lucia Cerchie</dc:creator>
      <pubDate>Fri, 28 Oct 2022 20:14:27 +0000</pubDate>
      <link>https://forem.com/cerchie/what-does-batching-mean-when-were-talking-about-apache-kafka-293a</link>
      <guid>https://forem.com/cerchie/what-does-batching-mean-when-were-talking-about-apache-kafka-293a</guid>
      <description>&lt;p&gt;Today I learned that when you hear the word 'batch' in the context of Apache Kafka, it can mean one of two things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;A reference to batch-only data processing systems. Batch-only systems process data in a &lt;em&gt;bounded&lt;/em&gt; way. That means that there's a&lt;a href="https://www.oreilly.com/library/view/introduction-to-apache/9781491977132/ch06.html"&gt; start time and an end-time&lt;/a&gt;. Whether this batching is done in large or micro-batches, it is processed all at once. That's in contrast to the continuous data streaming that Apache Kafka enables, in which data is processed in event-sized pieces. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Within the data streaming context, there's something called producer batching. It's a bit of a misnomer because it's not really related to the batch-only data processing systems. A Kafka producer, the client that publishes records to the Kafka cluster, compresses messages via a process called batching to increase throughput. This batching is part of the process handling data at once and in event-sized pieces, so it doesn't mean the same thing as batch-only data processing.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In conclusion, 'batching' means, in a very general way, 'grouping stuff together'. But 'producer batching' and 'batch-only data processing systems' do not share the term in any significant sense, because they are referring to the completely different functions I described above. &lt;/p&gt;

</description>
      <category>apachekafka</category>
      <category>beginners</category>
      <category>todayilearned</category>
      <category>programming</category>
    </item>
    <item>
      <title>Installing node-rdkafka on M1 for use with SASL</title>
      <dc:creator>Lucia Cerchie</dc:creator>
      <pubDate>Fri, 14 Oct 2022 20:25:29 +0000</pubDate>
      <link>https://forem.com/cerchie/installing-node-rdkafka-on-m1-for-use-with-sasl-3i47</link>
      <guid>https://forem.com/cerchie/installing-node-rdkafka-on-m1-for-use-with-sasl-3i47</guid>
      <description>&lt;p&gt;If you're using Kafka in a Node.js app, it's likely that you'll need &lt;code&gt;node-rdkafka&lt;/code&gt;. This is a library that wraps the &lt;a href="https://github.com/edenhill/librdkafka"&gt;librdkafka &lt;/a&gt;library and makes it available in Node.js. According to the project's &lt;a href="https://github.com/Blizzard/node-rdkafka"&gt;README&lt;/a&gt;, "All the complexity of balancing writes across partitions and managing (possibly ever-changing) brokers should be encapsulated in the library." &lt;/p&gt;

&lt;p&gt;Installation steps may vary depending on the machine you're using, and whether you need SASL/SSL (Simple Authentication and Security Layer) support. You might need this, for example, if you're connecting to Confluent Cloud, as it is a required protocol to protect resources (see &lt;a href="https://docs.confluent.io/cloud/current/cp-component/clients-cloud-config.html#connect-clients-to-ccloud"&gt;docs&lt;/a&gt;). &lt;/p&gt;

&lt;p&gt;Here's a short, step by step guide on installing the &lt;code&gt;node-rdkafka&lt;/code&gt; client specifically on M1 (the first chip released by Apple specifically for Mac, &lt;a href="https://www.apple.com/newsroom/2020/11/apple-unleashes-m1/#:~:text=for%20the%20Mac-,M1%20is%20Apple's%20first%20chip%20designed%20specifically%20for%20the%20Mac,chip%20it%20has%20ever%20created."&gt;article here&lt;/a&gt;). &lt;/p&gt;

&lt;p&gt;Currently, as of September 30 '22, you have to do it manually. You can &lt;a href="https://github.com/confluentinc/confluent-kafka-python#install"&gt;find the reason why&lt;/a&gt; in the &lt;code&gt;confluent-kafka&lt;/code&gt; Python client README.md:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;NOTE: The pre-built Linux wheels do NOT contain SASL Kerberos/GSSAPI support. If you need SASL Kerberos/GSSAPI support you must install librdkafka and its dependencies using the repositories below and then build confluent-kafka using the instructions in the "Install from source" section below.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here are the steps you'll need to take for SSL/SASL support (run in your home directory):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/edenhill/librdkafka.git
cd ./librdkafka
./configure --install-deps --source-deps-only
make
sudo make install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Use &lt;a href="https://brew.sh/"&gt;homebrew&lt;/a&gt; to &lt;a href="https://formulae.brew.sh/formula/openssl@1.1"&gt;install openssl&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Navigate out of &lt;code&gt;./librdkafka&lt;/code&gt; and into your Node.js project directory.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Export these variables with these commands, to make sure that the path to openssl is correct:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export CPPFLAGS=-I/opt/homebrew/opt/openssl@3/include
export LDFLAGS=-L/opt/homebrew/opt/openssl@3/lib
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;install &lt;code&gt;openssl&lt;/code&gt; with &lt;code&gt;npm install openssl&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Next, install &lt;code&gt;node-rdkafka&lt;/code&gt; -- now you've got SSL support for your Node.js/Kafka project! &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Hopefully this helps! If you're still running into issues, you can post a request for help in &lt;a href="https://www.confluent.io/community/ask-the-community/"&gt;Confluent Community&lt;/a&gt;. &lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>todayilearned</category>
      <category>node</category>
      <category>linux</category>
    </item>
    <item>
      <title>Introduction to Key Apache KafkaⓇ Concepts</title>
      <dc:creator>Lucia Cerchie</dc:creator>
      <pubDate>Tue, 11 Oct 2022 20:37:58 +0000</pubDate>
      <link>https://forem.com/cerchie/introduction-to-key-apache-kafka-concepts-2mbp</link>
      <guid>https://forem.com/cerchie/introduction-to-key-apache-kafka-concepts-2mbp</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Last week I started a brand new role: Developer Advocate at &lt;a href="https://www.confluent.io/" rel="noopener noreferrer"&gt;Confluent&lt;/a&gt;. So far I’ve been gladdened by stepping fully into an area of tech that satisfies my teaching heart. I’ve also felt supported by my new teammates. I’m new to the Kafka scene, with a background in JavaScript and GraphQL. In order to help onboard me smoothly, my teammates are meeting with me frequently, checking in on my progress (they even reviewed this article 😉), and are helping me select material from Confluent’s abundance of resources to learn Kafka. &lt;/p&gt;

&lt;p&gt;My first step in my learning journey was this &lt;a href="https://rebrand.ly/zvqmzaq" rel="noopener noreferrer"&gt;course&lt;/a&gt; on Kafka 101. I took notes throughout the course, which broke Kafka down to its core concepts. I'll share the synthesis of those notes below in hopes that if you're coming from a similar background, you'll find it useful!&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Kafka?
&lt;/h2&gt;

&lt;p&gt;According to its website, Kafka is a "distributed event streaming platform".&lt;/p&gt;

&lt;p&gt;Well, what does that mean to me, a mostly-JavaScript developer with a background in web development and GraphQL? My usual approach to learning entirely new concepts is to take a back-to-square-one approach and understand some fundamental vocabulary first. Much like you might estimate the result of a math problem before tackling its execution (e.g., estimating that the sum of 219 + 38 will not be above 300), I like to situate myself with respect to the context of a new skill before executing it. The following paragraphs set the context of Kafka by defining and illustrating key concepts. &lt;/p&gt;

&lt;h2&gt;
  
  
  What is an Event?
&lt;/h2&gt;

&lt;p&gt;So, a "distributed event streaming platform". The key piece of terminology here is 'event'. Before I took the course, I understood an event as a 'thing that happens', which still holds up within the context of Kafka. In Kafka, events are things that happen, and the representation of these things are recorded by machines.&lt;/p&gt;

&lt;p&gt;Let’s take, for example, the event of a credit card transaction. The event is composed of a notification and the event’s state.  To implement this event in Kafka, you’d need certain pieces of information, including a key, value, timestamp, and optional metadata headers. So you’d have something like: &lt;/p&gt;

&lt;p&gt;Key: “Credit Card Payment”&lt;br&gt;
Value: “Paid $12.50 for a ham sandwich”&lt;br&gt;
Timestamp: “05/01/2022”&lt;/p&gt;

&lt;p&gt;Kafka serializes these pairs into a structured format like JSON, Avro, or Protobuf. By default, event sizes in Kafka are 1MB. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxeby04l97qsv3s9mrydx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxeby04l97qsv3s9mrydx.png" alt="screenshot of page using a diamond shape to illustrate the above words"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  What is a Topic?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fspsboydtked9a6suzycl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fspsboydtked9a6suzycl.png" alt="screenshot of page using a rectangle shape to illustrate the above words"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At a high level, topics are ways of organizing events. They are programmatic logs of events, as opposed to application logs. You can see &lt;a href="https://engineering.linkedin.com/distributed-systems/log-what-every-software-engineer-should-know-about-real-time-datas-unifying" rel="noopener noreferrer"&gt;this article by Jay Kreps &lt;/a&gt;to learn more about the difference. Logs have 3 noteworthy aspects:&lt;/p&gt;

&lt;p&gt;They are append-only. New messages are only applied to the end of a log. They can't be inserted—unlike with a different structure (like a graph).&lt;br&gt;
You can't change events in a log. This was important for me to wrap my head around since I was coming from a GraphQL background, and you can certainly mutate data objects using GraphQL.&lt;br&gt;
Access to logs is sequential from a given offset, so they're read by picking an arbitrary offset and scanning.&lt;/p&gt;
&lt;h2&gt;
  
  
  What is a Cluster?
&lt;/h2&gt;

&lt;p&gt;Ok, cool, but where are these events and logs kept so I can access them? Are they hosted somewhere? Kafka's storage layer is a cluster of things called brokers. Brokers are servers that handle things like write and read requests to partitions, as well as replication. Which brings us to:&lt;/p&gt;
&lt;h2&gt;
  
  
  What is a Partition?
&lt;/h2&gt;

&lt;p&gt;Logs are hosted and replicated across a cluster of machines, rather than clogging up one machine 🪠. &lt;br&gt;
Partitions make this possible. They take a single topic log and break it up into multiple logs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F70af3fqmwawj82wkj6ti.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F70af3fqmwawj82wkj6ti.png" alt="screenshot of page using a diamond shape to illustrate the above words"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, how are messages written to partitions? If the messages are keyless, they'll be assigned one after the other until the last partition is reached, in which case the process starts from the top. Messages which have keys are assigned to partitions holding messages with the same keys. Kafka does this by hashing the key and using a &lt;a href="https://research.cs.vt.edu/AVresearch/hashing/modfunc.php" rel="noopener noreferrer"&gt;mod function&lt;/a&gt;. If you want to take a deep dive into partitions, you can read &lt;a href="https://riferrei.com/in-the-land-of-the-sizing-the-one-partition-kafka-topic-is-king/" rel="noopener noreferrer"&gt;this blog post by Ricardo Ferreira&lt;/a&gt; that examines them from the perspective of both developers and data ops.&lt;/p&gt;
&lt;h2&gt;
  
  
  What is a Producer?
&lt;/h2&gt;

&lt;p&gt;The producer sends the key value pairs to the clusters, managing the interaction between brokers over a network. Incidentally, producers are also responsible for message assignment to partitions. You can view a producer instance created with the Confluent client in Python in the&lt;a href="https://rebrand.ly/637tb96" rel="noopener noreferrer"&gt; Confluent Developer website&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;   &lt;span class="c1"&gt;# Parse the configuration.
&lt;/span&gt;    &lt;span class="c1"&gt;# See https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md
&lt;/span&gt;    &lt;span class="n"&gt;config_parser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;ConfigParser&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;config_parser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read_file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;config_file&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;config_parser&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;default&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;

    &lt;span class="c1"&gt;# Create Producer instance
&lt;/span&gt;    &lt;span class="n"&gt;producer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Producer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What is a Consumer?
&lt;/h2&gt;

&lt;p&gt;A Kafka consumer reads the data from the stream. Many independent consumers can read from one topic. When a message is read it is not deleted. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fywm2b9gbccpwvl8hjklg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fywm2b9gbccpwvl8hjklg.png" alt="screenshot of page using a diamond shape to illustrate the above words"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Consumers handle scaling automatically. You can see how to instantiate a consumer instance in Node.JS on the Confluent Developer "Getting Started" &lt;a href="https://developer.confluent.io/get-started/nodejs/#build-consumer" rel="noopener noreferrer"&gt;tutorial&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;createConsumer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;onData&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;consumer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Kafka&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;KafkaConsumer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="nf"&gt;createConfigMap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;auto.offset.reset&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;earliest&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;reject&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;consumer&lt;/span&gt;
     &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ready&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;consumer&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
     &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;data&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;onData&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="nx"&gt;consumer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Let's go back to the original definition of Kafka, a "distributed event streaming platform". We now know that an event is a representation of a thing that happens expressed in a key value pair. These events are organized by topics, logs which are partitioned by producers and read by consumers. The platform is a cluster of brokers that enable replication and fault tolerance. Together, this system is Kafka.&lt;br&gt;
The system arises from the viewpoint that data is not static -- that it's everywhere, flowing and interconnected. That doesn't mean you can't integrate streaming data with classic data sources like databases and REST APIs, or that you can't filter, transform, and manage it. But that's a topic for another day ;)&lt;/p&gt;

</description>
      <category>apachekafka</category>
      <category>programming</category>
      <category>beginners</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>How To GraphQL - Tutorials to Get You Started</title>
      <dc:creator>Lucia Cerchie</dc:creator>
      <pubDate>Tue, 21 Jun 2022 19:22:25 +0000</pubDate>
      <link>https://forem.com/stepzen/how-to-graphql-tutorials-to-get-you-started-45f4</link>
      <guid>https://forem.com/stepzen/how-to-graphql-tutorials-to-get-you-started-45f4</guid>
      <description>&lt;p&gt;&lt;a href="https://stepzen.com/" rel="noopener noreferrer"&gt;StepZen&lt;/a&gt; gets your GraphQL API deployed and running in minutes, with up to 5000 requests per second with low latency.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/c/StepZen" rel="noopener noreferrer"&gt;StepZen’s YouTube channel&lt;/a&gt; presents a wealth of short tutorials for learning how to use StepZen to build and deploy GraphQL. This helps you build projects that connect data from databases, REST APIs, external GraphQL APIs, and even SOAP APIs if that’s how you roll.&lt;/p&gt;

&lt;p&gt;Here are some of my favorites.&lt;/p&gt;

&lt;h2&gt;
  
  
  Query SaaS APIs with GraphQL in a Next.js App
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=xu0GNFvHQMs" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffc0hvqmpzgljhcjvo9ix.png" alt="link to YouTube"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this video, Roy teaches us how to query both the DEV.to REST API and the GitHub GraphQL API using &lt;a href="https://graphql.stepzen.com" rel="noopener noreferrer"&gt;StepZen GraphQL Studio&lt;/a&gt;. You can see how useful this can be for your development flow: Data for both APIs can be mocked before being loaded into a Next.js React application. Then, loading environment variables in your application introduce real data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two Ways to Query Airtable with GraphQL
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=el14JtW9WCM" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc0cq7sjbjnb1nowafx6s.png" alt="link to YouTube"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Airtable is a popular platform for building collaborative apps. In this video, you’ll learn more about real-life GraphQL by watching Roy query Airtable in two different ways. You can use the prebuilt Airtable GraphQL API provided in the &lt;a href="https://graphql.stepzen.com/" rel="noopener noreferrer"&gt;Studio&lt;/a&gt; or convert the REST API to GraphQL using ‘stepzen import curl’.&lt;/p&gt;

&lt;p&gt;Find a GraphQL API for Airtable in StepZen GraphQL Studio here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://graphql.stepzen.com/airtable" rel="noopener noreferrer"&gt;https://graphql.stepzen.com/airtable&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Automatically Generating TypeScript Types
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=rT_jKDNMgRw" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F42h66i0qkjvy73ftxygj.png" alt="link to YouTube"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Don’t fear TypeScript! Roy shows us how to generate TypeScript types for our GraphQL API endpoint. Since both TypeScript and GraphQL have a type system, you can use your GraphQL schema to generate TypeScript types. This video explains how to use GraphQL Code Generator to generate those types.&lt;/p&gt;

&lt;h2&gt;
  
  
  Combing Data From Node.js Microservices
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=wVog47hGmcA" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F26ft9ejf3l5l74i1ajor.png" alt="link to YouTube"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this video, we learn how to combine data from different Node.js microservices with GraphQL. You can use GraphQL as a data layer for these microservices and combine the data from all these services into a single, unified API to simplify your development process. Roy introduces us to building this data layer &lt;a href="https://stepzen.com/docs/connecting-backends" rel="noopener noreferrer"&gt;declaratively&lt;/a&gt; using StepZen’s custom directives.&lt;br&gt;
.&lt;/p&gt;

&lt;h2&gt;
  
  
  Load Testing GraphQL APIs With k6
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=OEk4lMFZEWA" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp6edvx9uewlxzlwxh2nv.png" alt="link to YouTube"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Watch Roy teach you how to load test a GraphQL API built with StepZen. He uses the &lt;a href="https://k6.io" rel="noopener noreferrer"&gt;open source library k6&lt;/a&gt; on a StepZen API that combines data from different sources. You can follow along with this video to test for yourself and see how a GraphQL API built and running on StepZen performs. You can also consult &lt;a href="https://stepzen.com/blog/load-testing-graphql-performance-k6" rel="noopener noreferrer"&gt;Roy’s blog post&lt;/a&gt; on the same topic.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where to Go From Here
&lt;/h2&gt;

&lt;p&gt;We've created a full &lt;a href="https://www.youtube.com/playlist?list=PLRbLs--WELU9KafLVjlfxgOmjHv0AHGsg" rel="noopener noreferrer"&gt;How-to Playlist&lt;/a&gt;. Subscribe to our YouTube channel and check back often - we add new tutorials weekly. And if there’s a how-to you’d like to see, let us know.&lt;/p&gt;

&lt;p&gt;If you have questions, feel free to &lt;a href="https://discord.com/invite/9k2VdPn2FR" rel="noopener noreferrer"&gt;slide into our Discord&lt;/a&gt;. We'd love to see you around! In fact, if you’re working on a GraphQL project and you’d like to join us for a community live stream or have us host your project as a YouTube video, just let us know. We’d love to host you and hear what you’re building.&lt;/p&gt;

&lt;p&gt;To learn more about creating GraphQL APIs quickly with StepZen, see:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/docs/getting-started"&gt;Getting Started&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/docs/connecting-backends"&gt;Connecting Backends&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/docs/cli"&gt;The StepZen CLI&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>graphql</category>
      <category>tutorial</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Consuming the Deepgram API: The GraphQL Edit</title>
      <dc:creator>Lucia Cerchie</dc:creator>
      <pubDate>Fri, 10 Jun 2022 19:11:27 +0000</pubDate>
      <link>https://forem.com/stepzen/consuming-the-deepgram-api-the-graphql-edit-ji6</link>
      <guid>https://forem.com/stepzen/consuming-the-deepgram-api-the-graphql-edit-ji6</guid>
      <description>&lt;p&gt;In this project, we’ll explore how to use Deepgram, StepZen, and Next.js to convert the Deepgram REST API into your own GraphQL API, translate audio to English and French text, and display the result in a user interface.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://developers.deepgram.com/api-reference/"&gt;Deepgram’s REST API&lt;/a&gt; - A speech-to-text API built on a 100% deep learning platform. It offers up to 90% translation accuracy with model training with no human validation necessary. I chose to write about it because the developer experience is excellent; should you want to extend the capabilities of this API further, you’ll find exactly what you need in Deepgram’s &lt;a href="https://developers.deepgram.com/"&gt;docs and tutorials&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;StepZen’s &lt;a href="https://rest2graphql.io/"&gt;REST2GraphQL&lt;/a&gt; tool - A user interface designed to convert your REST APIs to GraphQL, no code necessary. StepZen introspects the endpoint, generates a schema, and deploys your GraphQL endpoint once you hit ‘Generate’. These endpoints are public and are available for you to use and share for 30 days. To take the schema you’ve created with REST2GraphQL and create a private, scalable endpoint for it, &lt;a href="https://stepzen.com/signup"&gt;sign up for a StepZen account&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Next.js - A React framework providing features like &lt;a href="https://nextjs.org/docs/basic-features/pages"&gt;Server Side Rendering&lt;/a&gt;. We’ll use it in this tutorial to fetch the data from our GraphQL endpoint. That way, you’ll learn how to safely send an API key on a server-side request.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Converting the Deepgram REST API to GraphQL
&lt;/h2&gt;

&lt;p&gt;The first thing we’ll learn is how to use REST2GraphQL to convert Deepgram to a GraphQL API.&lt;/p&gt;

&lt;p&gt;Access the tool at &lt;a href="http://rest2graphql.io"&gt;rest2graphql.io&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, select ‘POST’ and enter the Deepgram ‘listen’ endpoint we’ll be using:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HVdLqbFM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/renkxnx4k66n84mssqfj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HVdLqbFM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/renkxnx4k66n84mssqfj.png" alt="rest2graphql http method selector" width="880" height="493"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, you’ll add some query parameters.&lt;/p&gt;

&lt;p&gt;Deepgram uses these parameters to determine the language to translate, the model to use, and whether to punctuate the text. They are sent to StepZen on ‘Generate’,  and StepZen creates a GraphQL schema with query variables matching these parameters.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--z69aXbCS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/frzca3tvac5mi4u5qdaj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--z69aXbCS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/frzca3tvac5mi4u5qdaj.png" alt="rest2graphql params selector" width="880" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You’ll also need to add your Deepgram API key under the &lt;strong&gt;Headers&lt;/strong&gt; tab to get access to your Deepgram endpoint. You can find the steps to create a Deepgram API key in the &lt;a href="https://developers.deepgram.com/documentation/getting-started/authentication/#create-an-api-key"&gt;Deepgram docs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Th4zdJC8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uum555z5mx5d4y8w7uk0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Th4zdJC8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uum555z5mx5d4y8w7uk0.png" alt="rest2graphql headers selector" width="880" height="549"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, click &lt;strong&gt;Generate&lt;/strong&gt;, and your endpoint is deployed! Query it in the browser with GraphiQL, or customize the values of your request’s variables with the ‘Query Arguments’ widget.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QAQdiUgo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kt4qkugju5irgzcr00df.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QAQdiUgo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kt4qkugju5irgzcr00df.png" alt="screenshot of deployed endpoint in interface" width="880" height="423"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Consuming the GraphQL API in a Next.js App
&lt;/h2&gt;

&lt;p&gt;Next, let’s look at how to consume your GraphQL endpoint in a Next.js app. I’ll show snippets to illustrate my steps, so here’s the &lt;a href="https://github.com/stepzen-dev/stepzen-deepgram-next-sample"&gt;Github repository&lt;/a&gt; if you’d like to clone the entire code.&lt;/p&gt;

&lt;p&gt;I started by &lt;a href="https://nextjs.org/docs/api-reference/create-next-app"&gt;creating a Next.js app&lt;/a&gt;. Then, I created a &lt;code&gt;getServerSideProps&lt;/code&gt; function to feed the data into the Home component, inside &lt;code&gt;pages/index.js&lt;/code&gt; .&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;getServerSideProps&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;Home&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;styles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;container&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Head&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;title&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Create Next App&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;title&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;meta&lt;/span&gt;
                    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"description"&lt;/span&gt;

&lt;span class="na"&gt;ETC&lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I wrote my fetch call inside the &lt;code&gt;getServerSideProps&lt;/code&gt; function. called the endpoint generated by REST2GraphQL, &lt;code&gt;https://public6ddcc5208696d858.stepzen.net/api/deepgram/__graphql&lt;/code&gt;, sent the headers required by the Deepgram API, and sent my GraphQL query as the body (you can check out the &lt;a href="https://rest2graphql.io/response?hash=7b7f6f7873372f38387b7f6f7873216e6f6f7a6d786b675b7f6f78732f38322f383e6b7f7e62657863706b7e6365642f394b21597e7863646d2f383b2f3849212f383e666b646d7f6b6d6f2f394b21597e7863646d2f3849212f383e67656e6f662f394b21597e7863646d2f3849212f383e7a7f64697e7f6b7e6f2f394b21597e7863646d2f3849212f383e7f78662f394b21597e7863646d2f38332f3d482f3f49646e6f6f7a6d786b675b7f6f78732f38326b7f7e62657863706b7e6365642f394b212f383e6b7f7e62657863706b7e6365642f384921666b646d7f6b6d6f2f394b212f383e666b646d7f6b6d6f2f38492167656e6f662f394b212f383e67656e6f662f3849217a7f64697e7f6b7e6f2f394b212f383e7a7f64697e7f6b7e6f2f3849217f78662f394b212f383e7f78662f38332f3d48676f7e6b6e6b7e6b2f3d4869626b64646f66792f384969786f6b7e6f6e2f38496e7f786b7e6365642f384967656e6f66792f3849786f7b7f6f797e55636e2f384979626b383f3c2f38497e786b64796b697e63656455616f732f3d4e2f3d4e2f3f49642f3d4e2f38382c6f646e7a6563647e37627e7e7a792f394b2f384c2f384c7a7f686663693c6e6e69693f383a323c333c6e323f3224797e6f7a706f6424646f7e2f384c6b7a632f384c6e6f6f7a6d786b672f384c55556d786b7a627b66"&gt;generated JavaScript boilerplate&lt;/a&gt; to see the query that I copied).&lt;/p&gt;

&lt;p&gt;I protected the &lt;strong&gt;apikey&lt;/strong&gt; by saving it in my &lt;code&gt;env.&lt;/code&gt; file. For information about how to use the fetch API with GraphQL, view &lt;a href="https://stepzen.com/docs/using-graphql/making-queries-with-fetch"&gt;StepZen’s documentation&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;apikey&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;DEEPGRAM_APIKEY&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;res_in_en&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt;  &lt;span class="nx"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://public6ddcc5208696d858.stepzen.net/api/deepgram/__graphql&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;Authorization&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`Token &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;apikey&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;query&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`
    query deepgramQuery($authorization: String!, $language: String, $model: String, $punctuate: String, $url: String) {
        deepgramQuery(
          authorization: $authorization
          language: $language
          model: $model
          punctuate: $punctuate
          url: $url
        ) {
          results {
            channels {
              alternatives {
                confidence
                transcript
                words {
                  confidence
                  end
                  punctuated_word
                  start
                  word
                }
              }
            }
          }
        }
      }
      `&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;variables&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://static.deepgram.com/examples/Bueller-Life-moves-pretty-fast.wav&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;language&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;en-US&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;general&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;punctuate&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;true&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;authorization&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`Token &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;DEEPGRAM_APIKEY&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;}),&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After making the call in the function, we transform the result into JSON and return it as props:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;en_data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;res_in_en&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;en_data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;notFound&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;props&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;en_data&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="c1"&gt;// will be passed to the page component as props&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, I surfaced the data text on the homepage by using the props passed from the &lt;code&gt;getServerSideProps&lt;/code&gt; function to the &lt;code&gt;Home&lt;/code&gt; component (something Next will do automatically here).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;DeepGram Samples&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
     &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h2&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;English Sample&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h2&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
         &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
           &lt;span class="si"&gt;{&lt;/span&gt;
     &lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;en_data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;deepgramQuery&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;results&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;channels&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;alternatives&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;transcript&lt;/span&gt;
            &lt;span class="si"&gt;}&lt;/span&gt;
         &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that, I can see it rendered in my &lt;a href="http://localhost"&gt;localhost&lt;/a&gt; endpoint!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--W1j3yr2K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/76sm79btfjz0ibkw82lc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--W1j3yr2K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/76sm79btfjz0ibkw82lc.png" alt="screenshot of rendered English text" width="880" height="387"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  French Sample
&lt;/h2&gt;

&lt;p&gt;So now I’d created an English sample… how about another language? Deepgram has support for 18 languages! Let’s try French. The first thing is to repeat the 'Converting the Deepgram REST API to GraphQL' process outlined above, but with a ‘fr’ value for the language parameter rather than ‘en-US’.&lt;/p&gt;

&lt;p&gt;I also used a French sample hosted at &lt;a href="https://www.lightbulblanguages.co.uk/resources/audio/quelageastu.mp3"&gt;&lt;code&gt;https://www.lightbulblanguages.co.uk/resources/audio/quelageastu.mp3&lt;/code&gt;&lt;/a&gt;. I then created a similar query and passed the result of it to &lt;code&gt;props&lt;/code&gt; as well. You can see my final version in the &lt;a href="https://github.com/stepzen-dev/stepzen-deepgram-next-sample"&gt;Github repository&lt;/a&gt;, or give it a go on your own!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2JP6gDub--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hp63bhl6fx4n8gqlx1s9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2JP6gDub--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hp63bhl6fx4n8gqlx1s9.png" alt="screenshot of rendered french text" width="880" height="386"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Where to Go From Here
&lt;/h2&gt;

&lt;p&gt;In this post, you learned how to convert Deepgram’s API to GraphQL with StepZen, then consume it in a Next.js app. To learn more about these technologies:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/docs/quick-start"&gt;StepZen documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/blog/"&gt;StepZen blog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="%5Bhttps://deepgram.com/blog/%5D(https://deepgram.com/blog/)"&gt;Deepgram blog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="%5Bhttps://nextjs.org/docs/getting-started%5D(https://nextjs.org/docs/getting-started)"&gt;Next.js docs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We hope you enjoy building your own project with StepZen; please know we’d be happy to help you learn more! Jump into our &lt;a href="%5Bhttps://discord.com/invite/9k2VdPn2FR%5D(https://discord.com/invite/9k2VdPn2FR)"&gt;Discord server&lt;/a&gt; to ask a question.&lt;/p&gt;

</description>
      <category>graphql</category>
      <category>api</category>
      <category>webdev</category>
      <category>tooling</category>
    </item>
    <item>
      <title>3 New GraphQL Developer Tools to Increase Coding Productivity</title>
      <dc:creator>Lucia Cerchie</dc:creator>
      <pubDate>Thu, 02 Jun 2022 17:44:57 +0000</pubDate>
      <link>https://forem.com/stepzen/3-new-graphql-developer-tools-to-increase-coding-productivity-4la7</link>
      <guid>https://forem.com/stepzen/3-new-graphql-developer-tools-to-increase-coding-productivity-4la7</guid>
      <description>&lt;p&gt;In our mission to make building GraphQL APIs easier for every developer, StepZen developed tools to get you started quickly and with either no- or low- code.  In this post, we’ll explore some of the tools we’ve built. We’ll take a look at REST2GraphQL, an interface that enables you to convert your REST API into a GraphQL endpoint, as well as JSON2SDL, which enables you to transform JSON to Schema Definition Language. You’ll also learn how to use the StepZen cli to import a GraphQL API in a short tutorial. Let’s get started!&lt;/p&gt;

&lt;h2&gt;
  
  
  REST2GraphQL
&lt;/h2&gt;

&lt;p&gt;With &lt;a href="https://rest2graphql.io/" rel="noopener noreferrer"&gt;REST2GraphQL&lt;/a&gt;, you can enter a REST endpoint, click submit, and receive a new endpoint to access the GraphQL version of the API.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbpgbtn0wyd2kueg1dn4m.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbpgbtn0wyd2kueg1dn4m.gif" alt="graphql interface gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Converting REST to GraphQL is useful for many reasons. Among them is the introduction of REST to your GraphQL layer. I encourage you to give REST2GraphQL a try as a way of testing out StepZen as your GraphQL mechanism.&lt;/p&gt;

&lt;h2&gt;
  
  
  JSON2SDL
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1rdmw0qf18k87s2p50xi.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1rdmw0qf18k87s2p50xi.gif" alt="json2sdl interface gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://JSON2SDL.com" rel="noopener noreferrer"&gt;JSON2SDL.com&lt;/a&gt; is a great tool to convert JSON results into a GraphQL schema. You can use it when you only need to convert part of a REST API’s functionality to GraphQL. For example,  a GET call to Github’s meta endpoint, &lt;a href="https://api.github.com/" rel="noopener noreferrer"&gt;https://api.github.com/&lt;/a&gt; returns this data:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"current_user_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/user"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"current_user_authorizations_html_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://github.com/settings/connections/applications{/client_id}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"authorizations_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/authorizations"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"code_search_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/search/code?q={query}{&amp;amp;page,per_page,sort,order}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"commit_search_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/search/commits?q={query}{&amp;amp;page,per_page,sort,order}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"emails_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/user/emails"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"emojis_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/emojis"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"events_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/events"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"feeds_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/feeds"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"followers_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/user/followers"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"following_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/user/following{/target}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"gists_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/gists{/gist_id}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"hub_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/hub"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"issue_search_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/search/issues?q={query}{&amp;amp;page,per_page,sort,order}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"issues_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/issues"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"keys_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/user/keys"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"label_search_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/search/labels?q={query}&amp;amp;repository_id={repository_id}{&amp;amp;page,per_page}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"notifications_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/notifications"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"organization_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/orgs/{org}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"organization_repositories_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/orgs/{org}/repos{?type,page,per_page,sort}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"organization_teams_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/orgs/{org}/teams"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"public_gists_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/gists/public"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"rate_limit_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/rate_limit"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"repository_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/repos/{owner}/{repo}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"repository_search_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/search/repositories?q={query}{&amp;amp;page,per_page,sort,order}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"current_user_repositories_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/user/repos{?type,page,per_page,sort}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"starred_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/user/starred{/owner}{/repo}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"starred_gists_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/gists/starred"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"topic_search_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/search/topics?q={query}{&amp;amp;page,per_page}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"user_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/users/{user}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"user_organizations_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/user/orgs"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"user_repositories_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/users/{user}/repos{?type,page,per_page,sort}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"user_search_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/search/users?q={query}{&amp;amp;page,per_page,sort,order}"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Oof! Let’s say you only need the data coming back that directly relates to users. That’s:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"current_user_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/user"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"current_user_authorizations_html_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://github.com/settings/connections/applications{/client_id}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"user_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/users/{user}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"user_organizations_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/user/orgs"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"user_repositories_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/users/{user}/repos{?type,page,per_page,sort}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"user_search_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com/search/users?q={query}{&amp;amp;page,per_page,sort,order}"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Paste that into JSON2SDL.com, and boom! you’ve got a nicely pared-down GraphQL schema.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight graphql"&gt;&lt;code&gt;&lt;span class="k"&gt;type&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Root&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="n"&gt;current_user_authorizations_html_url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="n"&gt;current_user_url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="n"&gt;user_organizations_url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="n"&gt;user_repositories_url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="n"&gt;user_search_url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="n"&gt;user_url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;code&gt;stepzen import&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;StepZen’s cli tool enables you to import all kinds of backends. Give it a try with a GraphQL API!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd5d8zebfqcoxcmqiqhv3.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd5d8zebfqcoxcmqiqhv3.gif" alt="clif gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight graphql"&gt;&lt;code&gt;&lt;span class="err"&gt;npm&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;-g&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;stepzen&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="err"&gt;stepzen&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;login&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;--public&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="err"&gt;mkdir&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;gql&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;gql&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="err"&gt;stepzen&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;import&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;graphql&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And enter&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight graphql"&gt;&lt;code&gt;&lt;span class="err"&gt;https://graphqldd.stepzen.net/api/dd1cf47f51ac830fe21dc00ec80cee65/__graphql&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;when you’re prompted to enter your endpoint. You can hit ‘enter’ for the other prompts since you won’t need authentication or headers to walk through this example.&lt;/p&gt;

&lt;p&gt;Et voila! Behold, your schema is downloaded.&lt;/p&gt;

&lt;p&gt;Now, to deploy your API, run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight graphql"&gt;&lt;code&gt;&lt;span class="err"&gt;stepzen&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;start&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can now query it at the &lt;a href="http://localhost" rel="noopener noreferrer"&gt;localhost&lt;/a&gt; address provided, or consume it at the URL you’ve been provided as well.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;We’ve covered three ways to increase your productivity when building a GraphQL API, whether you want to import an entire endpoint or only access some of its data, whether you’d like to convert a data source to GraphQL using either a graphic user interface or a command-line interface.  We hope you find these ways of speeding up your development process useful!&lt;/p&gt;

&lt;p&gt;Now, sometimes developers trade speed of development for maintainability in the long run. We’d like to note that with StepZen, you don’t have to make that tradeoff. If you sign up for an account, you’ll be able to create a fully protected backend, whether with JWT or API keys, or both. We also have a &amp;gt;99.99% uptime. We are happy to take care of these details so you don’t have to sacrifice your strategic solidity for tactical concerns.&lt;/p&gt;

&lt;p&gt;If you’d like to learn more about why you’d choose StepZen, visit our &lt;a href="https://stepzen.com/why-stepzen" rel="noopener noreferrer"&gt;Why StepZen&lt;/a&gt; page.&lt;/p&gt;

&lt;p&gt;You can also&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Check out StepZen &lt;a href="https://www.notion.so/docs/design-a-graphql-schema" rel="noopener noreferrer"&gt;docs&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://graphql.stepzen.com/" rel="noopener noreferrer"&gt;pre-built SaaS APIs&lt;/a&gt; in the GraphQL Studio.&lt;/li&gt;
&lt;li&gt;We're always keen to see what you're building and answer any questions on &lt;a href="https://discord.com/invite/9k2VdPn2FR" rel="noopener noreferrer"&gt;Discord&lt;/a&gt;!&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>graphql</category>
      <category>showdev</category>
      <category>webdev</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Convert REST to GraphQL: A New Low-Code Approach</title>
      <dc:creator>Lucia Cerchie</dc:creator>
      <pubDate>Tue, 31 May 2022 20:37:11 +0000</pubDate>
      <link>https://forem.com/stepzen/convert-rest-to-graphql-a-new-low-code-approach-56ml</link>
      <guid>https://forem.com/stepzen/convert-rest-to-graphql-a-new-low-code-approach-56ml</guid>
      <description>&lt;p&gt;Today's API and app economy is built on REST. After a couple of decades of investment in REST, it's no surprise that most of the APIs that developers consume are REST. GraphQL is the relative newcomer. Its strengths are the ability to query everything you need and only what you need, and an improved developer experience supported by capabilities like self-documentation and query hinting. This landscape leaves savvy developers looking for ways to leverage GraphQL into a world where a lot of the data they need to build today's compelling experiences resides at REST API backends. So how to transform REST endpoints to GraphQL?&lt;/p&gt;

&lt;p&gt;Transforming REST into GraphQL doesn't have to be an arduous task. You can already do so in a &lt;a href="https://dev.to/getting-started?details=rest"&gt;few lines of code with StepZen&lt;/a&gt;. And we've just made it even easier with a new &lt;a href="https://rest2graphql.io/"&gt;REST2GraphQL&lt;/a&gt; conversion tool!&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://rest2graphql.io/"&gt;REST2GraphQL&lt;/a&gt; tool requires no CLI download and no StepZen account. It lets you create a fully functional GraphQL API from your REST endpoint. Your GraphQL API is deployed right away and available to call from your app or command line. The GraphQL API is public and is running and available for 30 days at no cost to you. Share it, query it, build against it. At any time, take what you've built, make it a permanently deployed endpoint and easily customize it, by &lt;a href="https://dev.to/signup"&gt;signing up&lt;/a&gt; for a free StepZen account.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to transform REST to GraphQL with one click
&lt;/h2&gt;

&lt;p&gt;Paste your REST endpoint URL into the field in the &lt;a href="https://rest2graphql.io/"&gt;REST2GraphQL&lt;/a&gt; web tool and click &lt;strong&gt;Generate&lt;/strong&gt;. StepZen inspects your REST endpoint and generates the GraphQL API for you. Now the Endpoint field displays the GraphQL endpoint.&lt;/p&gt;

&lt;p&gt;You can explore, test, and query the endpoint in the GraphiQL browser. Better still, you can build with your GraphQL API right away. You can even share it with your team and friends for them to build with it. You'll get code samples in a few languages that you can use to call the API. All in all you'll have a GraphQL API up and running in minutes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qTGL0yuP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4uekp67442u9pk0h0xtx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qTGL0yuP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4uekp67442u9pk0h0xtx.png" alt="screenshot of user interface" width="880" height="502"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with REST endpoint - no query params, no headers
&lt;/h2&gt;

&lt;p&gt;In its simplest mode, you can generate a GraphQL API by providing just the REST endpoint value. If you start with the example provided in the tool, you'll see the REST endpoint is &lt;a href="https://jsonplaceholder.typicode.com/todos/1"&gt;&lt;code&gt;https://jsonplaceholder.typicode.com/todos/1&lt;/code&gt;&lt;/a&gt;. You can leave the Query Params, Header, and JSON fields blank, click &lt;strong&gt;Generate&lt;/strong&gt; and see the GraphQL API generated for you, as well as cURL, JavaScript, and Python code you can use to call it.&lt;/p&gt;

&lt;h2&gt;
  
  
  POST JSON Data
&lt;/h2&gt;

&lt;p&gt;But what if we needed to post some JSON data? For this example, we'll use the httpbin sample API: &lt;a href="https://httpbin.org/post"&gt;&lt;code&gt;https://httpbin.org/post&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First, select the POST method:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NEmhsBtF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l3aaqoce0gwkm78wsejv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NEmhsBtF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l3aaqoce0gwkm78wsejv.png" alt="tab with POST selected&amp;lt;br&amp;gt;
 " width="880" height="515"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, paste the JSON that you'd like to send and click &lt;strong&gt;Generate&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LOpxb4nG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0kr3wzp56qrnqlt7wazv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LOpxb4nG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0kr3wzp56qrnqlt7wazv.png" alt="tab with json entered" width="880" height="667"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your GraphQL API is generated for you, its URL is provided in the Endpoint field: &lt;code&gt;https://publicb93954a786e9c842.stepzen.net/api/httpbin/__graphql&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;On inspection of the JavaScript code example that we can use to query the GraphQL API, we can see that it generates a query with parameters for the JSON we need to send, &lt;code&gt;key1&lt;/code&gt; and &lt;code&gt;key2&lt;/code&gt;, evident in the &lt;code&gt;variables: {}&lt;/code&gt; field.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;headers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{};&lt;/span&gt;

&lt;span class="nx"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;graphql&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;query&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;query httpbinQuery($key1: String, $key2: String){&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;    httpbinQuery(key1: $key1, key2: $key2){&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;        args&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;        data&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;        files&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;        form&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;        headers{&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;            Accept&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;            Host&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;        }&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;        json{&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;            key1&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;            key2&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;        }&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;        origin&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;        url&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;    }&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;}&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;variables&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;key1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="na"&gt;key2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;requestOptions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;graphql&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="nx"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://publicb93954a786e9c842.stepzen.net/api/httpbin/__graphql&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;requestOptions&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;error&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Add a Query Parameter
&lt;/h2&gt;

&lt;p&gt;Now, say we have an endpoint, &lt;a href="https://ghibliapi.herokuapp.com/films?limit=1"&gt;&lt;code&gt;https://ghibliapi.herokuapp.com/films?limit=1&lt;/code&gt;&lt;/a&gt;, which takes the query parameter &lt;code&gt;limit&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Enter the endpoint URL in the &lt;strong&gt;Endpoint&lt;/strong&gt; field:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--glTFeNZe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6lzdihv723o3555s5srg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--glTFeNZe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6lzdihv723o3555s5srg.png" alt="screenshot of params tab" width="880" height="515"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And enter the query params in the &lt;strong&gt;Query Params&lt;/strong&gt; key and value fields&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7Ep3N6iR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sx3jw5sp393aruzow9hq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7Ep3N6iR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sx3jw5sp393aruzow9hq.png" alt="screenshot of params tab with entered params" width="880" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Generate&lt;/strong&gt; and see that the query parameter is translated into your cURL request.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;--request&lt;/span&gt; POST &lt;span class="s1"&gt;'https://publicf1bf36ef9fe92aea.stepzen.net/api/ghibliapi/__graphql'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;--header&lt;/span&gt; &lt;span class="s1"&gt;'Content-Type: application/json'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;--data-raw&lt;/span&gt; &lt;span class="s1"&gt;'{"query":"query ghibliapiQuery($limit: String){\n    ghibliapiQuery(limit: $limit){\n        description\n        director\n        id\n        image\n        locations\n        movie_banner\n        original_title\n        original_title_romanised\n        people\n        producer\n        release_date\n        rt_score\n        running_time\n        species\n        title\n        url\n        vehicles\n    }\n}","variables":{}}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Add a Path Parameter
&lt;/h2&gt;

&lt;p&gt;To add a path parameter to your request, enter the path and value inside the path parameter tab.&lt;/p&gt;

&lt;p&gt;Using the &lt;a href="https://jsonplaceholder.typicode.com/todos/1"&gt;https://jsonplaceholder.typicode.com/todos/1&lt;/a&gt; REST endpoint as an example, the &lt;strong&gt;Path Params&lt;/strong&gt; values are &lt;code&gt;/todos/$todo&lt;/code&gt; and &lt;code&gt;1&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fwqcRf-B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ac200ov7i9njbbe20k5e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fwqcRf-B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ac200ov7i9njbbe20k5e.png" alt="screenshot of tool path params page" width="880" height="536"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Examine the JavaScript, Python , and cURL examples generated for you to see how the path parameters are used.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oqHXYR7W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jrpfoko87m69ers95aqu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oqHXYR7W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jrpfoko87m69ers95aqu.png" alt="screenshot of boilerplate" width="880" height="722"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping it up
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://rest2graphql.io/"&gt;REST2GraphQL&lt;/a&gt; requires no CLI download and no StepZen account. You can create a fully functional GraphQL API from your REST endpoint. It is deployed right away and available to call from your app or command line. Your public endpoint is available for 30 days for you to use in your projects and share with others. If you'd like to have a permanent endpoint, want to extend and customize the one you create here, want to combine two REST endpoints in one GraphQL API, and more, &lt;a href="https://dev.to/signup"&gt;sign up&lt;/a&gt; for a free account.&lt;/p&gt;

&lt;p&gt;With your StepZen account, you can generate a GraphQL API for &lt;em&gt;any&lt;/em&gt; REST, SQL, or NoSQL endpoint in a few minutes. You can  use StepZen's GraphQL directives &lt;a href="https://dev.to/docs/connecting-backends/how-to-connect-a-rest-service"&gt;@rest&lt;/a&gt;, &lt;a href="https://dev.to/docs/connecting-backends/how-to-connect-a-mysql-database"&gt;@dbquery&lt;/a&gt;, &lt;a href="https://dev.to/docs/connecting-backends/how-to-connect-a-graphql-api"&gt;@graphql&lt;/a&gt;, and &lt;a href="https://dev.to/docs/custom-graphql-directives/directives"&gt;others&lt;/a&gt; to customize your GraphQL. See &lt;a href="https://dev.to/getting-started"&gt;Getting Started&lt;/a&gt; to launch the quickstart.&lt;/p&gt;

&lt;p&gt;We hope you &lt;a href="https://rest2graphql.io/"&gt;REST2GraphQL&lt;/a&gt; useful. We'd love your feedback and suggestions and we're always keen to hear about the things you're building and answer any questions. Hope to see you over on &lt;a href="https://discord.gg/9k2VdPn2FR"&gt;Discord&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>graphql</category>
      <category>tutorial</category>
      <category>showdev</category>
      <category>api</category>
    </item>
    <item>
      <title>A New Postman Collection of GraphQL APIs for the SaaS Services You Love</title>
      <dc:creator>Lucia Cerchie</dc:creator>
      <pubDate>Mon, 16 May 2022 19:42:32 +0000</pubDate>
      <link>https://forem.com/stepzen/a-new-postman-collection-of-graphql-apis-for-the-saas-services-you-love-3mgh</link>
      <guid>https://forem.com/stepzen/a-new-postman-collection-of-graphql-apis-for-the-saas-services-you-love-3mgh</guid>
      <description>&lt;p&gt;Postman’s platform includes a new &lt;a href="https://www.youtube.com/watch?v=NlrPjuXEaZ8&amp;amp;t=1s"&gt;collections feature&lt;/a&gt; to group saved API requests and share them with your colleagues or the world!&lt;/p&gt;

&lt;p&gt;StepZen has created a unique Postman &lt;a href="https://www.postman.com/stepzen?tab=collections"&gt;collection of GraphQL APIs&lt;/a&gt; for you to try out.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Sas2zBLq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://stepzen.com/images/blog/postman-images/postman1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Sas2zBLq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://stepzen.com/images/blog/postman-images/postman1.png" alt="Screen Shot 1" width="880" height="328"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The collection features a wide range of APIs, including the APIs of platforms like &lt;a href="https://postman.com/stepzen/workspace/graphql-apis/documentation/14821533-307584da-5c68-49b9-8943-2c25be00dad9"&gt;Github,&lt;/a&gt; &lt;a href="https://postman.com/stepzen/workspace/graphql-apis/documentation/14821533-17b264d5-b294-41ec-b1d8-e5f5e43c4231"&gt;Spotify&lt;/a&gt;, and &lt;a href="https://postman.com/stepzen/workspace/graphql-apis/documentation/14821533-b786d0a7-2ceb-48f8-bf4e-2707fa52e072"&gt;Twitter&lt;/a&gt;. It's also got a &lt;a href="https://postman.com/stepzen/workspace/graphql-apis/documentation/16344328-87d00f8b-213e-45e4-a72b-5ebd7ab07efd"&gt;Web3 collection&lt;/a&gt; that features the Moralis server for Web3 apps.&lt;/p&gt;

&lt;p&gt;Give each API a spin in the &lt;a href="https://www.postman.com/stepzen/workspace/graphql-apis-for-saas-services/collection/14821533-2a22c345-63d6-4a98-a74a-580fc780154b?ctx=documentation"&gt;GraphQL APIs for SaaS Services collection&lt;/a&gt; by&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;selecting the API folder and then selecting ‘queries’&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jZtTigkl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://stepzen.com/images/blog/postman-images/postman2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jZtTigkl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://stepzen.com/images/blog/postman-images/postman2.png" alt="Screen Shot 2" width="584" height="407"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Hitting ‘Send’ and viewing your query response&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cvvZM0FD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://stepzen.com/images/blog/postman-images/postman3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cvvZM0FD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://stepzen.com/images/blog/postman-images/postman3.png" alt="Screen Shot 3" width="880" height="528"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Create Your Own GraphQL Collections By Forking Ours
&lt;/h2&gt;

&lt;p&gt;One of the convenient features of Postman Collections is that you can fork a collection and edit it yourself. Here are the steps for riffing on our collections to make your own.&lt;/p&gt;

&lt;p&gt;Select ‘create a fork’.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nq3fjJYx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://stepzen.com/images/blog/postman-images/postman4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nq3fjJYx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://stepzen.com/images/blog/postman-images/postman4.png" alt="Screen Shot 4" width="585" height="1308"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Label your fork and click ‘Fork Collection’.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--svVoYN7f--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://stepzen.com/images/blog/postman-images/postman5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--svVoYN7f--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://stepzen.com/images/blog/postman-images/postman5.png" alt="Screen Shot 5" width="880" height="918"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your fork is now available in the workspace you selected. You can now add your own queries to the API by clicking ‘Duplicate’.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9Wec6z-v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://stepzen.com/images/blog/postman-images/postman6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9Wec6z-v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://stepzen.com/images/blog/postman-images/postman6.png" alt="Screen Shot 6" width="587" height="732"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can now edit the name, endpoint, and body of your request.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Jp-M4O0b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://stepzen.com/images/blog/postman-images/postman7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Jp-M4O0b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://stepzen.com/images/blog/postman-images/postman7.png" alt="Screen Shot 7" width="880" height="372"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;We’ve seen some awesome projects created with these APIs, from a &lt;a href="https://dev.to/blog/building-a-stock-trading-app-with-stepzen-and-alpacadb"&gt;stock trading website&lt;/a&gt; to an &lt;a href="https://dev.to/blog/animating-api-results-on-a-budget"&gt;animation app&lt;/a&gt;, to a &lt;a href="https://dev.to/blog/stepzen-sveltekit-and-the-dev-api"&gt;serverless blog&lt;/a&gt;. We'd love to see what you come up with! If you’d like to see where our APIs are sourced from, visit &lt;a href="https://graphql.stepzen.com/"&gt;https://graphql.stepzen.com/&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you have questions, feel free to &lt;a href="https://discord.com/invite/9k2VdPn2FR"&gt;slide into our Discord&lt;/a&gt;. We'd love to see you around!&lt;/p&gt;

&lt;p&gt;To learn more about creating GraphQL APIs quickly with StepZen, see&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/docs/getting-started"&gt;Getting Started&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/docs/connecting-backends"&gt;Connecting Backends&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/docs/design-a-graphql-schema"&gt;Design A GraphQL Schema&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/docs/cli"&gt;The StepZen CLI&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>graphql</category>
      <category>showdev</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
