<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jason Lengstorf on Medium]]></title>
        <description><![CDATA[Stories by Jason Lengstorf on Medium]]></description>
        <link>https://medium.com/@jlengstorf?source=rss-6a98eb806571------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*2HtRupxBOVL67OVfgMBTdg.jpeg</url>
            <title>Stories by Jason Lengstorf on Medium</title>
            <link>https://medium.com/@jlengstorf?source=rss-6a98eb806571------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 23 May 2026 06:40:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jlengstorf/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Serverless Functions the Fast Way]]></title>
            <link>https://medium.com/better-practices/serverless-functions-the-fast-way-43d6128ff8d5?source=rss-6a98eb806571------2</link>
            <guid isPermaLink="false">https://medium.com/p/43d6128ff8d5</guid>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Jason Lengstorf]]></dc:creator>
            <pubDate>Tue, 23 Jun 2020 21:13:28 GMT</pubDate>
            <atom:updated>2020-06-23T21:13:28.884Z</atom:updated>
            <content:encoded><![CDATA[<h4>Learn what they are, and how to create and deploy them in minutes with Netlify Functions</h4><p>For frontend developers, one of the biggest hurdles to creating full-blown web apps is the backend. In fact, there are often multiple hurdles hiding in the backend. For example, how do you process form submissions? And how can you store data?</p><p>It might seem that you need to create and manage a full-blown server in order to handle these types of use cases. But what if you could handle form submissions, requests to and from a database, and other server-like activities with a single JavaScript function, deployed with two lines of configuration?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5ggKeRrQYM59VutL907FaQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@alvannee?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Alvan Nee</a> on <a href="https://unsplash.com/s/photos/corgi?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>With “serverless functions,” you can do exactly that. In other words, yes, it’s possible to create complete backends — which can handle many server-like activities — using only JavaScript functions.</p><p>In this tutorial, we’ll learn what serverless functions are, how to create them, and how we can deploy them in seconds with <a href="https://www.netlify.com/products/functions/?utm_source=postman-blog&amp;utm_medium=sls-intro-jl&amp;utm_campaign=devex">Netlify Functions</a>!</p><h3><strong><em>What is a serverless function?</em></strong></h3><p>Serverless functions are a way to encapsulate event-driven, server-like logic without the boilerplate steps of setting up a full-blown server. Serverless functions can talk to databases, call third-party services, process user input, and more. They <em>cannot</em> store data themselves or keep a long-running process available.</p><h3>What does “serverless” mean?</h3><p>A serverless function doesn’t actually mean there’s no server. It means that you, the developer, are not responsible for setting up or managing the server infrastructure — all you need to worry about is the actual business logic that needs to be performed!</p><p>Now, let’s get started with the tutorial, which will walk through these five steps:</p><ol><li>Create your first serverless function</li><li>Deploy the functions to Netlify</li><li>Handle form data</li><li>Send authorized requests to third-party APIs</li><li>Deploy the form</li></ol><h3>1. Create your first serverless function</h3><p>Let’s start by creating the simplest possible serverless function and getting it deployed to the internet. This should take about 5 minutes. 🤯</p><h4>Create the project and function file</h4><p>On your computer, create a new folder for the functions to live in.</p><pre># create a new folder<br>mkdir serverless-functions-the-fast-way</pre><pre># move into the new folder<br>cd serverless-functions-the-fast-way/</pre><p>Next, make a functions folder in the new folder.</p><pre># create a directory called functions<br>mkdir functions</pre><p>Inside the functions folder, create a new file called hello-world.js — this will be our serverless function!</p><pre># create the file for your first serverless function<br>touch functions/hello-world.js</pre><p>Inside hello-world.js, add the following code:</p><pre>exports.handler = async () =&gt; {<br>  return {<br>    statusCode: 200,<br>    body: &#39;Hello world!&#39;,<br>  };<br>};</pre><p>This is a complete serverless function. No joke. This JavaScript function returns an <a href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html">HTTP status code</a> of 200 (for “OK”) and a plain text body of “Hello world!”.</p><p>Now that we’ve created the serverless function, let’s get set up to test it locally!</p><h4>Set up Netlify</h4><p>First, we need to install the <a href="https://docs.netlify.com/cli/get-started/?utm_source=postman-blog&amp;utm_medium=sls-intro-jl&amp;utm_campaign=devex">Netlify CLI</a> on our computer and log in to make sure we have access to our Netlify account:</p><pre># install the Netlify CLI<br>npm i -g netlify-cli</pre><pre># log into your Netlify account<br>ntl login</pre><blockquote><em>💡 </em><strong><em>Note:</em></strong><em> if you don’t already have a Netlify account, you can </em><a href="https://app.netlify.com/signup?utm_source=postman-blog&amp;utm_medium=sls-intro-jl&amp;utm_campaign=devex"><em>set one up for free</em></a><em> using your GitHub, GitLab, Bitbucket, or email address in a few seconds.</em></blockquote><p>Next, create netlify.toml at the root of our project.</p><pre># create a Netlify config file in the project root<br>touch netlify.toml</pre><p>Inside netlify.toml, we configure Netlify Functions by adding two lines of config:</p><pre>[build]<br>  functions = &quot;functions&quot;</pre><p>This tells Netlify that we want to enable Netlify Functions and that it should look in the functions folder to find them. Once we’ve set this, Netlify will do the rest!</p><h4>Start the server</h4><p>We have access to a local development server called <a href="https://www.netlify.com/products/dev/?utm_source=postman-blog&amp;utm_medium=sls-intro-jl&amp;utm_campaign=devex">Netlify Dev</a> that supports serverless functions. To run it, we’ll use the CLI:</p><pre>ntl dev</pre><p>This starts up a local server with our serverless function available for testing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yod1_RgeIpw6nCHG4poZtA.png" /><figcaption>use local developer server called Netlify Dev</figcaption></figure><h4>Send a request</h4><p>Netlify makes serverless functions accessible by URL using the format {SITE_URL}/.netlify/functions/{FUNCTION_FILE_NAME} — this means that our test function is available locally at http://localhost:8888/.netlify/functions/hello-world. We can try out our serverless function by sending a request with Postman.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p7ui8nF4ir-JutB9HVJghQ.png" /><figcaption>try out the serverless function by sending a request with Postman</figcaption></figure><p>We can see that the result comes back with a “200 OK” response and the text “Hello world!” — success! We’ve just written and tested our first serverless function!</p><h3>2. Deploy the functions to Netlify</h3><p>Next, let’s get this function live at a public URL so it can be used from anywhere in the world.</p><h4>Create a new GitHub repository and push your code to it</h4><p>First, go to your GitHub account and <a href="https://github.com/new">create a new repository</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6pYvOO6UlfwHMNvkM3ZoDg.png" /><figcaption>create a new GitHub repository</figcaption></figure><p>Next, we need to:</p><ul><li>Initialize the project folder as a Git repository</li><li>Add the GitHub repo as its remote origin</li><li>Add all the files and commit them</li><li>Push the code to our GitHub repo</li></ul><pre>git init</pre><pre># NOTE: don’t forget to add your own username and repo here!<br>git remote add origin git@github.com:yourusername/serverless-functions-the-fast-way.git<br>git add -A<br>git commit -m &#39;first serverless function!&#39;<br>git push origin master</pre><h4>Initialize a new Netlify site</h4><p>Now that our code is available on GitHub, we need to initialize a new Netlify site. Using the CLI, this takes a single command:</p><pre>ntl init</pre><p>The CLI will guide us through creating a new site and then show us our new site’s URL and other details. Choose “Create &amp; configure a new site” when prompted. We don’t need a build command and we’re going to keep static files in the repo root, so we can keep the default answers to those CLI’s prompts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zlCvAdhxFBUIhiCtlZc6FA.png" /><figcaption>initialize a new Netlify site</figcaption></figure><p>Once the site is live, we can send a request to the live function by replacing http://localhost:8888 with our new Netlify site URL!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RYC1xHxjzL3LBYUrM_5Fag.png" /><figcaption>send a request to our new Netlify site URL</figcaption></figure><p>We’re using the <a href="https://www.postman.com/product/api-client/">Postman API Client</a> in this example, but this also works if we visit our function in the browser. (You can see my function by visiting <a href="https://pedantic-perlman-2f1bba.netlify.app/.netlify/functions/hello-world">https://pedantic-perlman-2f1bba.netlify.app/.netlify/functions/hello-world</a>.)</p><p><strong>At this point, we’ve successfully built, tested, and deployed a serverless function.</strong> Not bad for writing 6 lines of JavaScript and 2 lines of config!</p><h3>3. Handle form data</h3><p>To take our serverless functions to a more practical place, let’s create a simple HTML form that will allow our site visitors to search for an image, which we’ll get using the <a href="https://unsplash.com/developers">Unsplash API</a>.</p><h4>Create an HTML form</h4><p>To start, let’s create an HTML file at the root of our project called index.html. Inside, create a form with a single field, named query, that takes a search query as input and submits to a serverless function called search that we’ll create next.</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>  &lt;head&gt;<br>    &lt;meta charset=&quot;UTF-8&quot; /&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot; /&gt;<br>    &lt;title&gt;Search for a Photo!&lt;/title&gt;<br>  &lt;/head&gt;<br>  &lt;body&gt;<br>    &lt;main&gt;<br>      &lt;h1&gt;Search for a Photo!&lt;/h1&gt;<br>      &lt;form action=&quot;/.netlify/functions/search&quot; method=&quot;POST&quot;&gt;<br>        &lt;label for=&quot;query&quot;&gt;Search&lt;/label&gt;<br>        &lt;input type=&quot;text&quot; id=&quot;query&quot; name=&quot;query&quot; /&gt;<br>        &lt;button&gt;Submit&lt;/button&gt;<br>      &lt;/form&gt;<br>    &lt;/main&gt;<br>  &lt;/body&gt;<br>&lt;/html&gt;</pre><h4>Create a serverless function</h4><p>Next, add a new function called search.js in the functions folder and add the following, which uses Node’s built in querystring module to parse the form data and returns it:</p><pre>const qs = require(&#39;querystring&#39;);</pre><pre>exports.handler = async (event) =&gt; {<br>  const { query } = qs.parse(event.body);</pre><pre>  return {<br>    statusCode: 200,<br>    body: JSON.stringify({ query }),<br>  };<br>};</pre><p>To test, stop the server if it’s still running (press control + C), then run ntl dev and send a POST request to http://localhost:8888/.netlify/functions/search with a <a href="https://learning.postman.com/docs/postman/sending-api-requests/requests/#url-encoded">URL-encoded body</a> of query=corgi. The function will respond with the query.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rBgziMrzmM--K1dQi5mWog.png" /><figcaption>send a request to the new search function</figcaption></figure><p>Now we need to send this query off to Unsplash to get photos back.</p><h3>4. Send authorized requests to third-party APIs</h3><p>Because requests to the Unsplash API require private credentials, we can’t send requests from the client-side — that would expose the credentials and allow anyone to impersonate us when making API calls. Fortunately, serverless functions can make requests with credentials securely, which means we can safely use our Unsplash API key in our serverless function to search.</p><blockquote><strong><em>💡 Heads up! </em></strong><em>Joyce Lin and I talked all about </em><a href="https://www.learnwithjason.dev/protect-secret-keys-in-jamstack-apps"><em>keeping sensitive credentials secure in Jamstack apps</em></a><em> on </em>Learn With Jason<em>. Check it out for more details!</em></blockquote><h4>Get an API key</h4><p>Head over to <a href="https://unsplash.com/developers">https://unsplash.com/developers</a> and sign in, create an app, and get your access key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jd9fv4hoSv6YP2h0tcU0cg.png" /><figcaption>create a demo Unsplash app and get your access key</figcaption></figure><h4>Add the API key as an environment variable in the Netlify app</h4><p>Next, we need to store the Unsplash access token as an environment variable for our Netlify site. This is done through the Netlify web app, which we can quickly open through the CLI:</p><pre>ntl open</pre><p>Inside the app UI, click “Settings”, then “Build &amp; deploy”, then “Environment”, and add a new environment variable called UNSPLASH_API_TOKEN with the access token as its value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o85oU3xmDjBfCgM29I8A8Q.png" /><figcaption>add the Unsplash token as an environment variable in Netlify</figcaption></figure><h4>Update the function</h4><p>Now that we have the access token in our environment, we can update the function to send search requests to Unsplash.</p><p>First, let’s initialize our project with a package.json and install node-fetch so we can make requests using the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API">Fetch API</a>.</p><pre># create a package.json for this project<br>npm init -y</pre><pre># install dependencies<br>npm install node-fetch</pre><p>Next, let’s refactor our function to make a secure request to Unsplash and return the results as JSON.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9a59e532cddcb0fe431b1182f7040aa1/href">https://medium.com/media/9a59e532cddcb0fe431b1182f7040aa1/href</a></iframe><p>To test this, run ntl dev — note that the environment variable is loaded automatically for local testing!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u4oNPW58tvlwJPl1Za-2eg.png" /><figcaption>run the local server, and note the environment variable is loaded automatically</figcaption></figure><p>We can re-run our POST request and we’ll see the Unsplash response come back.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kJ4aPFoVyLa6_GhqSanFUA.png" /><figcaption>run the request, which invokes the search function that uses the Unsplash access token</figcaption></figure><h4>Return HTML</h4><p>In addition to JSON you can return HTML (or any content type, really)! Let’s refactor our function to return an HTML &lt;img&gt; tag to display the first image returned from Unsplash.</p><figure><a href="https://github.com/postmanlabs/gists/blob/master/returnhtml.diff"><img alt="" src="https://cdn-images-1.medium.com/max/905/1*8-BEJfYeygVWTt8tSAnG3w.png" /></a></figure><p>After saving this change — note that ntl dev automatically reloads the function when we save — we can re-run our POST request again and see that the image HTML is returned!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6GveZcuPrkAbSNbBXJv2bA.png" /><figcaption>run the request again to see the image HTML returned</figcaption></figure><h3>5. Deploy the form</h3><p>The last step is to deploy our search form to production.</p><p>To start, we need to add node_modules to the .gitignore file.</p><pre># Local Netlify folder<br>  .netlify<br>+ node_modules</pre><p>Next, let’s commit the rest of our new files.</p><pre>git add -A<br>git commit -m &#39;add search form and function&#39;<br>git push origin master</pre><p>The site will automatically rebuild because we pushed changes to Git. We can see it rebuilding if we open up the Netlify web app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lye5BtTxhtpwfC_s4tkwuw.png" /><figcaption>see the Netlify app’s deploy status</figcaption></figure><p>Once the site finishes deploying, visit the live site and we’ll see our search form.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aLq-Prep0pI6S-YIHZdu_w.png" /><figcaption>visit the deployed site</figcaption></figure><p>Enter in a search term and press the submit button and we’ll see an Unsplash image!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*29zvUf-Sq2hJKX2bIckG2Q.png" /><figcaption>search for corgis</figcaption></figure><p>We’ve now written, tested, and deployed two serverless functions, as well as sent authenticated requests to third-party APIs. That’s a whole bunch of back-end-style code without having to build, configure, or manage any actual back-ends!</p><h3>This is just the beginning</h3><p>This tutorial covered the essentials of building and deploying serverless functions with Netlify. From here, you have all the building blocks to create anything you can imagine using serverless functions.</p><p>Whether you want to <a href="https://www.netlify.com/blog/2019/11/18/what-are-microservices/?utm_source=postman-blog&amp;utm_medium=sls-intro-jl&amp;utm_campaign=devex">build serverless microservices</a>, create a <a href="https://www.netlify.com/blog/2020/04/13/learn-how-to-accept-money-on-jamstack-sites-in-38-minutes/?utm_campaign=devex&amp;utm_medium=stripe-jl&amp;utm_source=blog?utm_source=postman-blog&amp;utm_medium=sls-intro-jl&amp;utm_campaign=devex">Stripe-powered Jamstack e-commerce store</a>, or do something entirely new and different, the principles you’ve learned in this tutorial will help get you there!</p><h3>Next steps</h3><ul><li><a href="https://pedantic-perlman-2f1bba.netlify.app/">See the photo-search demo</a></li><li><a href="https://github.com/jlengstorf/serverless-functions-the-fast-way">View the source code on GitHub</a></li><li><a href="http://app.netlify.com/start/deploy?repository=https://github.com/jlengstorf/serverless-functions-the-fast-way&amp;utm_source=postman-blog&amp;utm_medium=sls-intro-jl&amp;utm_campaign=devex">Deploy your own copy of this demo with Netlify</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43d6128ff8d5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/better-practices/serverless-functions-the-fast-way-43d6128ff8d5">Serverless Functions the Fast Way</a> was originally published in <a href="https://medium.com/better-practices">Better Practices</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tutorial: Schema Stitching in GraphQL from Scratch]]></title>
            <link>https://medium.com/@jlengstorf/tutorial-schema-stitching-in-graphql-from-scratch-35d0a35f4028?source=rss-6a98eb806571------2</link>
            <guid isPermaLink="false">https://medium.com/p/35d0a35f4028</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[schema-stitching]]></category>
            <category><![CDATA[graphql]]></category>
            <category><![CDATA[gramps]]></category>
            <category><![CDATA[apollo]]></category>
            <dc:creator><![CDATA[Jason Lengstorf]]></dc:creator>
            <pubDate>Tue, 16 Jan 2018 17:41:02 GMT</pubDate>
            <atom:updated>2018-01-16T17:43:41.621Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-nc-nd/4.0/</cc:license>
            <content:encoded><![CDATA[<p>One of the most powerful ways to use GraphQL is to combine two distinct GraphQL schemas, allowing us to create aggregate queries that can load data from multiple back-ends. This is called <a href="https://www.apollographql.com/docs/graphql-tools/schema-stitching.html">schema stitching</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hcicx_G5RnZq_eXBEq19Rg.jpeg" /><figcaption>Stitch together multiple data sources for more powerful GraphQL servers.</figcaption></figure><p>In this tutorial, we’ll learn how easy it is to <strong>stitch together two GraphQL data sources following the GrAMPS format.</strong></p><blockquote>GrAMPS is a small tool to <a href="https://gramps.js.org/data-source/data-source-overview/">make your GraphQL schema definitions reusable and shareable</a>. When combined with schema stitching, developers can now publish a data source as an npm package, allowing us to combine and remix different data sources with no code duplication! 🎉</blockquote><blockquote>Make sure to <a href="https://github.com/gramps-graphql/gramps">check out the source</a> on GitHub, <a href="https://gramps.js.org/overview/quickstart/">try out the quickstart</a>, and maybe even give the repo a star. ⭐️</blockquote><h3>Part 1: Create a Data Source</h3><p>To get started, let’s <strong>create our first data source</strong> using the GraphQL CLI:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c734027fc7d33971ec0bb290e67562ec/href">https://medium.com/media/c734027fc7d33971ec0bb290e67562ec/href</a></iframe><p>In src/index.js, we can declare the entire data source for the sake of simplicity:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e3509206bd95869cd33c5bd946a5bd55/href">https://medium.com/media/e3509206bd95869cd33c5bd946a5bd55/href</a></iframe><p>This data source exposes two queries:</p><ul><li>getContext — returns an array of object keys that are present in the data source’s context object</li><li>getById — exposes id and value fields</li></ul><p>Let’s test this out by running the data source:</p><pre>yarn dev</pre><p>At <a href="http://localhost:8080/playground">http://localhost:8080/playground</a>, run the following query:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b2c71e437d4479ac69cd6cfdcd302f01/href">https://medium.com/media/b2c71e437d4479ac69cd6cfdcd302f01/href</a></iframe><p>We should see the following return value:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/80d106c0a73c214f0be36b97a5646a87/href">https://medium.com/media/80d106c0a73c214f0be36b97a5646a87/href</a></iframe><p>So far so good.</p><h3>Add Local Schema Stitching</h3><p>Next, let’s add some schema stitching to the existing data source, just to make sure it’s working the way we expected.</p><p>In src/index.js, add a stitching property with the following definitions:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bbb65a6eeea932490dfcda6f7cbd96ae/href">https://medium.com/media/bbb65a6eeea932490dfcda6f7cbd96ae/href</a></iframe><p>Restart the data source in your terminal (ctrl + C to stop, yarn dev to start), head to <a href="http://localhost:8080/playground">http://localhost:8080/playground</a>, and run the following query:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9fce67acf796b4be422f274a33fa01e5/href">https://medium.com/media/9fce67acf796b4be422f274a33fa01e5/href</a></iframe><p>We should see the following return value:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/690a3afc14e79c9abfa3911da609630a/href">https://medium.com/media/690a3afc14e79c9abfa3911da609630a/href</a></iframe><p><strong><em>NOTE:</em></strong><em> Notice that the contexts are different in </em><em>getStitchingContext. This happens because each data source scopes its context to its own namespace to prevent accidentally relying on another data source&#39;s context. However, schema stitching </em>does<em> rely on multiple data source&#39;s contexts, so we include </em>all<em> of the data sources&#39; contexts.</em></p><h3>Add a Second Data Source</h3><p>Next, let’s create a second data source so we can set up more realistic schema stitching.</p><p>In your terminal, move into the same directory where your first data source was created, then run the following to create a second data source:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2bb87ff03434803bc95848e52c134bd8/href">https://medium.com/media/2bb87ff03434803bc95848e52c134bd8/href</a></iframe><p>In src/index.js, create the second data source all in one place:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bbd3e399fbd7c418495daa4a0639ddfe/href">https://medium.com/media/bbd3e399fbd7c418495daa4a0639ddfe/href</a></iframe><p>This data source is pretty bare bones: it has a single query — getSomeValues — that exposes three fields that have text and echo the val the query was called with.</p><p>To test it, let’s fire up the new data source along with the original data source:</p><pre>yarn dev --data-source ../data-source-stitchingtest</pre><p><strong><em>NOTE:</em></strong><em> </em><em>yarn dev is shorthand for </em><em>gramps dev --data-source ., so what we&#39;re doing here is effectively running </em><em>gramps dev --data-source . --data-source ../data-source-stitchingtest</em></p><p>Open <a href="http://localhost:8080/playground">http://localhost:8080/playground</a> and update the query to call getSomeValues:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/35d34c0687f25d73e4cb178f2cf027a9/href">https://medium.com/media/35d34c0687f25d73e4cb178f2cf027a9/href</a></iframe><p>The output should be:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dab86fb39d855b8e7ee0471de4b9023a/href">https://medium.com/media/dab86fb39d855b8e7ee0471de4b9023a/href</a></iframe><h3>Use Schema Stitching to Combine the Two Data Sources</h3><p>Finally, let’s add stitching config to tie the two data source together. In the second data source, add the following:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/93e86f643b0d60cea1890ba8d01ce90d/href">https://medium.com/media/93e86f643b0d60cea1890ba8d01ce90d/href</a></iframe><p>First, we use linkTypeDefs to extend the STX_Test type by adding a new field called stitched.</p><p>Then, in resolvers, we set up stitched — which is a field on our first data source, remember — to get its value from the getSomeValues query, which is in the second data source.</p><p>Under the hood, this is done using <a href="https://www.apollographql.com/docs/graphql-tools/schema-stitching.html#mergeSchemas">mergeSchemas</a>. Be sure to check that out for additional information about how schema stitching happens, and some of the different ways you can work with it.</p><p>With the stitching config in place, let’s fire it up and test it.</p><p>Run the following command to start a gateway with both data sources:</p><pre>yarn dev --data-source ../data-source-stitchingtest</pre><p>Then, open <a href="http://localhost:8080/playground">http://localhost:8080/playground</a> and add the stitching field to the query:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1d5282f947e7e0cc112e2395a2dbad36/href">https://medium.com/media/1d5282f947e7e0cc112e2395a2dbad36/href</a></iframe><p>Once executed, we’ll see the following:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cfd59ffbc2e5cd1059f74081977fb26a/href">https://medium.com/media/cfd59ffbc2e5cd1059f74081977fb26a/href</a></iframe><p>And that’s it! We now have one data source including data from a second data source as part of its own queries.</p><p>For more information, see the <a href="https://gramps.js.org/data-source/data-source-overview/">GrAMPS data source docs</a>.</p><p><strong>Did you enjoy this post?</strong> Please consider clapping, sharing this article, or retweeting this tweet:</p><h3>Jason Lengstorf on Twitter</h3><p>Interested in #GraphQL schema stitching? I wrote up a tutorial on how you can tie together independent data sources in just a few lines of code. https://t.co/HeQHN1auwS</p><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=35d0a35f4028" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Cult of Work You Never Meant to Join]]></title>
            <link>https://medium.com/digital-nomad-stories/the-cult-of-work-you-never-meant-to-join-cd965fb9ea1a?source=rss-6a98eb806571------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd965fb9ea1a</guid>
            <category><![CDATA[work]]></category>
            <category><![CDATA[happiness]]></category>
            <category><![CDATA[health]]></category>
            <dc:creator><![CDATA[Jason Lengstorf]]></dc:creator>
            <pubDate>Wed, 15 Apr 2015 12:40:33 GMT</pubDate>
            <atom:updated>2016-03-14T06:09:48.341Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rmsoIeSyOT9SefRxOvthLA.jpeg" /><figcaption>This post was originally published on <a href="http://lengstorf.com/overkill-cult/?utm_source=medium-com&amp;utm_medium=top-image-caption&amp;utm_campaign=overkill-cult">lengstorf.com</a> <em>on March 27, 2015.</em></figcaption></figure><blockquote>Are our most valuable qualities being exploited at work? How our strengths get twisted into forming bad habits that — if we don’t change fast —<strong> just might kill us.</strong></blockquote><p>You didn’t mean to end up here. You didn’t even see it coming.</p><p>It all started with a chance to earn a living doing something you loved. Your dream job. Creating things instead of rotting in a cubicle. You weren’t just going to make a living — <em>you were going to leave your mark on the world.</em></p><p>At first, you loved the work; it was challenging and fast-paced. Everyone around you was crazy smart.</p><p>You brainstormed in your off time. Took projects home with you. Put in extra hours on weekends. It never felt like overworking because it never felt like work.</p><p>You put in way more than 40 hours a week, but who was counting? This was <em>fun.</em></p><p>But weeks passed into months and somehow you ended up here: Working 60 hours a week minimum, usually more. You greet your coworkers, bleary-eyed, half-joking about needing coffee to survive.</p><p>The work is still fun, but you don’t feel the same passion anymore. Whole days slip by sometimes and you have no idea what happened; you certainly don’t have much to show for it.</p><p>Your goals outside of work are on hold. You’d love to find out if the Belgians have anything to be cocky about waffle-wise, but you don’t have time for a big trip right now. You know you need to get into an exercise routine, but something always comes up and you skip the gym.</p><p>“Later,” you promise yourself, “I’ll get around to it soon.”</p><p>You’re not exactly <em>un</em>happy, but something’s off. You can’t put your finger on it. You’ve just always felt that there would be . . . <em>more.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*t-uYZ90jpSCm4Kjn.jpg" /><figcaption>You’re being force-fed an “ideal” work ethic that’s actually toxic for everyone involved.</figcaption></figure><h3>You’ve Been Absorbed</h3><p>You’re no longer a free member of society. You’ve been lured into the <strong>Overkill Cult</strong>.</p><blockquote><strong>The Overkill Cult is a cultural delusion that working 60+ hours each week — at the expense of everything else in our lives — is not only a necessary part of success, but that doing so is somehow <em>honorable.</em></strong></blockquote><p>The insidious thing about the Overkill Cult is that it masquerades as all the things we like most about ourselves: dedication, ambition, follow-through, responsibility.</p><p>It tells us to push harder, stay later, sleep when we’re dead. It tells us we’re never going to get ahead if we don’t show up first and go home last.</p><p>Cleverly, wickedly, the Overkill Cult persuades us to hang ourselves with our own strengths.</p><p>And if we don’t break free, we’re all going to die.</p><h3>The Overkill Cult Will Kill You (Like It Tried to Kill Me)</h3><p>Balance is the first thing to go once the Overkill Cult has us in its grasp.</p><p>For me, it started with my health. I skipped the gym — <em>too busy</em>, I thought. I didn’t have time to cook — <em>too busy</em> — so I ordered delivery.</p><p>My hobbies went next. Everything that wasn’t work fell away — <em>too busy, too busy</em> — until I was on the computer constantly, working. <strong>In 2012, I was working 70–90 hours a week.</strong></p><p>After that, I lost my social life. Friends knew I wouldn’t show up — <em>can’t; too busy</em> — so they stopped calling. Some days my only human interaction was ordering coffee.</p><p>Then — and this, sadly, is where I finally realized there was a problem — I lost my beard.</p><h3>The Canary in the Coal Mine, or How I Killed My Beard</h3><p>At the end of 2012, I landed the biggest project of my career at that point: a Black Friday sales site for a Fortune 100 company.</p><p>I was thrilled and terrified. A project like this had the potential to move my company to the next level, and I decided to do whatever it took to make this project the best I’d ever built.</p><p>The designers had great ideas, and I sat with them to make sure they were possible on our timeline. We came up with a slick, modern idea built on cutting-edge technology. The client loved it.</p><p>Then bureaucracy came into play. The legal department made changes. Brand adherence contradicted legal. Design went over schedule. <em>Way</em> over schedule.</p><p>By the time the design was approved, I had a third of the time we’d scheduled. And — since this was a Black Friday site — we couldn’t push back the release date. It either launched on time or I was a failure. Period.</p><p>Not to be defeated, I powered through four straight days leading up to Black Friday, sleeping <em>maybe</em> six hours total. On Thanksgiving Day I skipped family get-togethers in favor of making the final push.</p><p>I was exhausted. Delirious. But, goddammit, <em>I finished the project.</em></p><p>The client was thrilled. The site won a couple Addy Awards. I assume they made a metric fuckton in holiday sales.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*eqg24Zlf9BUto-JD.jpg" /><figcaption>May, 2013 — about six months after my Black Friday fiasco.</figcaption></figure><p>Over the next few months, patches of my beard started to turn white. The whiskers became ultra-fine. Then they fell out altogether.</p><p>Shortly afterward, I lost my ability to grow a beard entirely — I was left with the unsavory choice between a clean-shaven “giant fat baby” look and a creepy mustache.</p><p>I had stressed myself out so badly that my body had forgotten how to grow a beard. And for what? So I could work 19-hour days and skip family holidays to meet crazy deadlines?</p><p>I was exhausted. My body was failing. I was overwhelmed and unhappy and isolated. <em>I had a mustache, for chrissakes.</em></p><p>I had been guzzling the Overkill Cult’s Kool-Aid.</p><p>Something had to change.</p><h3>How to Tell If You’re in a Cult</h3><p>The telltale signs we’ve fallen prey to the Overkill Cult’s influence are subtle:</p><ul><li>Frequently working more than 40 hours a week</li><li>Frequently sleeping less than 6 hours a night</li><li>Feeling guilty about any time away from work — even if that time is with family and friends</li></ul><p>We don’t join overnight — this is <a href="http://en.wikipedia.org/wiki/Creeping_normality">death by a thousand cuts</a> — and once we’ve joined, we’ll probably deny it.</p><p>But we’ve joined. By the thousands, we’ve joined.</p><h3>The Lies of the Overkill Cult</h3><p>The Overkill Cult’s siren song seems like a healthy sense of ambition. “We have to work hard to get ahead.” It’s something we’ve been told our entire lives.</p><p>We’re doing what we think is best for the future.</p><p>But the Overkill Cult doesn’t plan for survivors.</p><p>Though the symptoms of the Overkill Cult grow from good intentions, they’re short-sighted habits that ultimately do more harm than good.</p><p>Let’s look at each of the Overkill Cult’s telltale signs, and how each of them is a long-term detriment disguised as a healthy work ethic.</p><h4>Frequently Working More than 40 Hours a Week</h4><p>Long hours often feel mandatory — it’s just part of the culture. We think, “My boss/coworkers/cat will judge me if I’m not working the same long hours as everyone else. I’ll never get ahead if I don’t go above and beyond.”</p><p>This is just what it takes to make it, right?</p><p><strong>Wrong.</strong> Incredibly, terribly, <em>spectacularly</em> wrong.</p><p>Research has proven over and over again that <strong>it’s not possible to be productive for more than 40 hours a week.</strong> At least not for sustained periods of time. Henry Ford introduced the 40-hour work week in 1914 because he saw — through research — that workers on <a href="http://www.salon.com/2012/03/14/bring_back_the_40_hour_work_week/">five eight-hour shifts kept up the highest sustained levels of productivity</a>.</p><p>Despite over 100 years of research supporting shorter work weeks, many companies still push for long hours, under the claims of a “sprint” or “crunch time” period.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*UQJyR3dxTnba99XE.jpg" /><figcaption>This diagram is loosely based on one included in Sidney J. Chapman’s <em>Hours of Labor</em>.</figcaption></figure><p>The irony comes in when we look at productivity over time. After just two months of 60-hour weeks, <a href="http://lengstorf.com/overtime-hurts-productivity/?utm_source=medium-com&amp;utm_medium=negative-productivity&amp;utm_campaign=overkill-cult">productivity goes <em>negative</em></a> compared to what a 40 hour week would have produced.</p><p>Did you catch that?</p><blockquote>By working 150% of the hours, you accomplish <em>less</em> in the long run.</blockquote><h4>Frequently Sleeping Less than 6 Hours a Night</h4><p>Somehow, sleeplessness has become a strange badge of honor. We swap “war stories” of sleeping two hours a night with an odd, martyred pride shining dimly in our bloodshot eyes.</p><p><em>I never sleep because </em><a href="http://genius.com/3012/Nas-ny-state-of-mind/I-never-sleep-cause-sleep-is-the-cousin-of-death"><em>sleep is the cousin of death</em></a><em>,</em> we murmur drowsily. <em>So many projects, so little time.</em></p><p>But this belief that burning the midnight oil somehow gets us ahead is utterly, tragically wrong.</p><p>You’re the <a href="http://www.ncbi.nlm.nih.gov/pmc/articles/PMC1739867/pdf/v057p00649.pdf">cognitive equivalent of a drunk driver</a> after being awake for 18 hours. But the problem compounds: if you don’t get enough sleep, that level of impairment comes faster the next day. After a few days of too little sleep, you’re a drunken zombie.</p><p>We wouldn’t go to work drunk, so why the hell do we go to work on four hours’ sleep, when we’re <em>more</em> impaired than if we were hammered?</p><p>To make matters worse, sleeping less than six hours a night <a href="http://news.bbc.co.uk/2/hi/health/8660373.stm">may lead to an early death</a>. The Overkill Cult is <em>literally</em> killing you.</p><h4>Feeling Guilty About Any Time Away from Work — Even Time with Family and Friends</h4><p>When we’re in the clutches of the Overkill Cult, we feel a stab of guilt when we’re not working.</p><p>“I’d love to go to this holiday party, but I really shouldn’t; this project won’t finish itself.”</p><p>We fear that any time not spent working is wasted.</p><p>The irony is — yet again — science tells us <em>exactly the opposite</em> is true.</p><p>Overworking leads to higher stress levels and burnout, which have been linked to <a href="http://www.tandfonline.com/doi/abs/10.3200/BMED.31.1.18-32#.VP2vuYGsWlI">increased health risks</a>.</p><p>Conversely, time away from work is proven to <a href="http://depts.washington.edu/hhwb/Thm_Mental.html">relieve stress</a> and <a href="http://psycnet.apa.org/psycinfo/2014-14435-001/">boost creativity</a>, among numerous other benefits.</p><p>Besides, if we accept that the ideal is to sleep 8 hours a night and work 8 hours a day, that leaves us with 8 hours for non-work activities.</p><p>Taking time away from work gives us time to recharge. It puts distance between us and our projects, giving us time to remember why we like doing what we do.</p><h3>Making Our Escape</h3><p>We may have been duped into joining the Overkill Cult, but <strong>it’s not too late to escape.</strong></p><p>We’ve been conned using our own best qualities to develop habits that — even though it <em>seems</em> like they’d make us better — make us worse at our jobs, less satisfied with our work, <em>and</em> less happy in our day-to-day lives.</p><p>Leveraging the same strengths the Overkill Cult exploits, we can break free of its clutches and take back our happiness and passion.</p><p>After my beard died, I felt the full weight of burnout. <em>I was burnt to a fucking crisp.</em> I realized I could either leave my career altogether, or make some fundamental changes to my lifestyle.</p><p>For what it’s worth, here are the promises I made to myself that helped me break away from the Overkill Cult.</p><h4>I Work as Much as I Can — But Not More</h4><p>Before anything else, I had to accept that <strong>it’s only possible to do 6–8 hours of quality work each day.</strong></p><p>Trying to work longer hours will not make me more productive. In fact, working longer hours actually results in me getting less done as time drags on.</p><p>I chose the latter, and implemented some radical (to me) <a href="http://lengstorf.com/effective-project-planning/?utm_source=medium-com&amp;utm_medium=effective-project-planning&amp;utm_campaign=overkill-cult">strategies for controlling my time</a>. <strong>I cut from an average of 70–90 hours a week in 2013 to an average 38 hours per week over the last year.</strong></p><p>I expected to see less professional success in favor of better overall balance in my life — a sacrifice I was willing to make — instead I saw <em>better</em> productivity at work: my turn-around times went down and I was more consistently hitting my deadlines.</p><p>I was floored at the time, but in retrospect I’m not surprised at all.</p><h4>I Make Sleep a Top Priority</h4><p>Getting enough sleep is beneficial on every level. Yet it was always the first thing I’d sacrifice when life got busy.</p><p>Too little sleep wreaks havoc on my ability to think clearly, and that hurts me at work in a big, bad way.</p><p>After I cut my hours down, I started sleeping without an alarm. Since I’m not working crazy hours, I close my computer by six or seven in the evening, and by eleven I’m usually in bed, where I read for a bit before falling asleep. I wake up naturally between seven and eight-thirty.</p><p>This has changed my life. No bullshit.</p><p>Waking up to an alarm before I’m fully rested starts the day in a groggy, stressful way. Waking up naturally after getting as much sleep as my body needs leaves me much happier to be awake, and far more ready to start my day.</p><h4>I Dedicate a Reasonable Amount of Time to NOT Working</h4><p>This was — and still is — the biggest challenge I faced in breaking away from the Overkill Cult. I love what I do, and I want to get my projects finished. It’s easy to rationalize working more hours and skipping activities that keep me from working.</p><p>But now I know that taking breaks makes me more productive: time away from work lets my passion and excitement for the work renew itself; taking my mind off of a project allows my subconscious to roll around abstract ideas that result in better solutions; breaks from the job lower my stress levels and boost my creativity.</p><p>So I make sure to take time off, even if my gut (incorrectly) tells me it’s a bad idea.</p><p>I take walks. I leave my phone in my pocket when I’m out with friends or eating my meals. I spend a fair amount of time on my hobbies, like writing and hunting for the world’s best cheeseburger.</p><p>I’m happier today than I can ever remember being in my life. I feel excited to work on my projects, to pursue my hobbies, and to spend time with people I love.</p><p><em>I’m excited to be alive.</em></p><h3>Leaving the Overkill Cult Saved My Life</h3><p><strong>When my beard died in 2013, I feared it was only the first sign of an impending decline in my health that would ultimately kill me.</strong> It was a glimpse into my future, and I was terrified that if I didn’t change, I was in for a life of isolation, ulcers, alopecia, and an eventual heart attack or stress-induced brain tumor.</p><p>By changing my lifestyle, I was able to turn things around. After just a year of balancing my work with the rest of my life, my beard grew back. I lost 30 pounds because I was actually going outside and making it to the gym. I felt more awake, and I <a href="https://medium.com/@jlengstorf/stop-glossing-over-the-good-stuff-b89e25f7c714">became more positive</a>.</p><p><strong>When I left the Overkill Cult, <em>everything</em> in my life improved. Not one single thing got worse.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PWcbdrGbPykAovEA.jpg" /><figcaption>Doing a superhero pose in front of a volcano in Costa Rica. (Notice my beard.)</figcaption></figure><h3>Are You Ready to Make Your Escape?</h3><p>If you’ve been sucked into the Overkill Cult, know that you’re not alone.</p><p>You may be facing cultural pressure to keep this crazy pace. You may be struggling with your identity as “a hard worker” and feeling that scaling back somehow makes you lazy or useless.</p><p>But I promise you — despite the doubts the Overkill Cult will force into your mind — there’s a better way. Better for your career. Better for your health. Better for your relationships. Better for your happiness.</p><p>You ended up in the Overkill Cult because you’re smart, ambitious, and dedicated. But you were misled by your good qualities and turned them into bad habits.</p><p>There’s a better way, and you’re smart enough to pull it off.</p><blockquote>Dump the Kool-Aid in the sink. Take back your freedom. Find the happiness and success you were looking for when you started this career.</blockquote><p>Close your computer. Go outside. And call your friends; they miss you.</p><h3>What’s Next?</h3><p>If you’re like me, you’d love to get away from the crazy hours and soul-sucking routines of the Overkill Cult, but you don’t feel like it’s possible.</p><p><strong>I was wrong. I just had to trust myself to take the first step.</strong></p><p>Wouldn’t it be nice to get some balance back? To have extra time <em>every day</em> to dedicate to the things that are most important to you?</p><p>I want to help: <strong>I’ve compiled <em>5 Habits of the Unfuckwithably Productive</em>, and </strong><a href="https://lengstorf.com/productivity-habits/"><strong>I want to give it to you for free</strong></a><strong>.</strong> These are time-tested habits that helped me escape the Overkill Cult; this is <em>how I spend less than 40 hours a week on the computer — while making a living and traveling the world.</em></p><p><a href="https://lengstorf.com/productivity-habits/">Click here to get the free guide</a>.</p><p><em>Did this post make you smile, think, or nod in approval? Please consider clicking “Recommend” below — I’d </em><strong><em>really</em></strong><em> appreciate it.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd965fb9ea1a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/digital-nomad-stories/the-cult-of-work-you-never-meant-to-join-cd965fb9ea1a">The Cult of Work You Never Meant to Join</a> was originally published in <a href="https://medium.com/digital-nomad-stories">This Publication is Moved</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop Glossing Over the Good Stuff]]></title>
            <link>https://medium.com/@jlengstorf/stop-glossing-over-the-good-stuff-b89e25f7c714?source=rss-6a98eb806571------2</link>
            <guid isPermaLink="false">https://medium.com/p/b89e25f7c714</guid>
            <dc:creator><![CDATA[Jason Lengstorf]]></dc:creator>
            <pubDate>Thu, 29 Jan 2015 16:34:46 GMT</pubDate>
            <atom:updated>2015-01-29T16:49:07.904Z</atom:updated>
            <content:encoded><![CDATA[<h4>How to Be Positive and Happy</h4><p>As simple as it seems, simply taking the time to recognize the good stuff can have a huge positive impact on your relationships with colleagues, significant others, friends, and clients.</p><h3>We Take a Good Thing for Granted</h3><p>As much as I hate to admit it, I’m kind of a shitty person by default.</p><p>With very few exceptions, every part of my day goes off perfectly.</p><p>I wake up fully rested in a comfortable bed, have a delicious, organic breakfast with the love of my life, have a cup of coffee from a local roaster that regularly wins national awards, and settle down to work (for myself) from the comfort of my own home on projects that I find both extremely interesting and intensely satisfying.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*sBRxV3mO9CDDVBMJeBOABg.jpeg" /><figcaption>At dinner in Louisville, KY, eating a delicious burger and drinking Pappy Van Winkle bourbon.</figcaption></figure><p>In the evenings, I meet with friends whose company I truly enjoy at cocktail lounges employing bartenders that look at an old-fashioned with the same air of professionalism as a surgeon about to perform a double bypass.</p><p>If we’re not up for drinks, we eat at a restaurant operated by a chef who’s won the James Beard Award more than once.</p><p>Every so often I’m asked to speak at a conference, which means I get paid to travel to a cool city like Austin or San Francisco and share my ideas with people who find what I do interesting.</p><p>But I’m <em>not</em> telling you this to brag about how great my life is.</p><p><strong>I’m trying to paint a picture of what an entitled asshole I can be.</strong></p><p>With all the great things I’m lucky enough to do on a regular basis, you might think that I wear a permanent grin on my face and pour out a Niagara-esque volume of gratitude.</p><p>But if you asked me how my day was a year ago, you’d probably hear something like:</p><p>“It’s okay, I guess.”</p><p>“Super busy. I’m pretty tired.”</p><p>“It’d be better if _____ would finally _____.”</p><p>What an ungrateful dick, right?</p><h3>“Are You Really Complaining Right Now?”</h3><p>My current contract is with a company called Precision Nutrition. It’s run by <a href="http://www.precisionnutrition.com/about/john-berardi">Dr. John Berardi</a> (or JB, as he’s often called) and <a href="http://www.precisionnutrition.com/issa/phil-caravaggio">Phil Caravaggio</a>, and employs a good number of truly brilliant people, including my long-time friend <a href="http://www.thenategreenexperience.com/">Nate Green</a>.</p><p>During a trip to Toronto for an all-hands PN meeting, JB, Phil, Nate, and myself went out for dinner at a very cool Italian restaurant called Gusto. We had an incredible family-style meal, and afterward we started talking about whatever was on our minds.</p><p>During the course of conversation, I made a couple negative comments; <strong>essentially, I started complaining about my situation.</strong></p><p>Phil looked me in the eye and asked, point blank, “Are you <em>really</em> complaining right now?”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/0*Ue6KNW0tbCkfjKaa.jpeg" /><figcaption>This is the table at Gusto in Toronto, ON, where I decided to start focusing more on the positive.</figcaption></figure><p>It caught me off guard to be challenged like that.</p><p>I was used to commiserating with other entrepreneurs about how “hard” our lives were and all the things we wished we could change.</p><p>Yet here was a fellow business owner staring at me like I’d just set the restaurant on fire.</p><h3>How Many Things Went Right Today?</h3><p>I started feeling foolish and fought the urge to start rambling in an attempt to backpedal. I decided the best thing I could do was try to steer into the skid.</p><p>“I guess I was, yeah.”</p><p>JB leaned in. “How many <em>good</em> things have happened to you today?”</p><p>My four-star hotel room and the day’s extremely successful meeting with PN flashed through my mind. I felt blood rushing to my cheeks.</p><p>“And how many <em>bad</em> things?”</p><p>I had to think pretty hard. I forgot toothpaste and had to call the front desk to get some. They sent peppermint, but I prefer spearmint. I had to wait in line for a taxi for, like, ten minutes.</p><p><strong>I was being a colossal tool.</strong></p><blockquote>“We tend to forget all the good things that happen to us.</blockquote><p>“I mean, why make a note of something that goes well?” Nate added, joining the conversation.</p><p>“But if something goes wrong, that sticks out in our minds. So when we think about our days, just the negative stuff jumps out at us and we complain.”</p><p>JB smiled and said, “It’s a psychological default. We all do it.”</p><p>“Until we decide to stop doing it,”<em> </em>Phil added.</p><p>JB swirled his wine and said:</p><blockquote>“This is going to feel silly, but list three good things about today. Anything at all.”</blockquote><p>I felt like a kid getting a lecture, but I knew they had all done this previously, so I played along.</p><p>“My hotel has a great shower, our meeting today was really productive, and this is one of the best Italian meals I’ve ever had.”</p><p>Phil beamed; he had picked the restaurant.</p><p>“It feels silly,” said JB, “but every time I find myself complaining, I immediately stop and list off three good things about my day.”</p><p>“Over time I stopped complaining, partly because I felt silly having to stop mid-conversation to derail a complaint,” JB paused, making eye contact, “and partly because I just didn’t think of the negative as much.”</p><h3>Reprogramming My Brain</h3><p>In the weeks that followed, that conversation stuck with me. I was acutely aware of my negativity, and admonished myself publicly by stopping mid-complaint to apologize and list the day’s high points.</p><p>It didn’t take long for me to notice a significant drop in complaints. But that wasn’t the only thing that happened; <strong>I started to pay more attention to the positive things as well.</strong></p><h3>Don’t Let the Good Go Unnoticed</h3><p>In my new effort to curb negativity, I started making “anti-complaints”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/0*tiAxQ0sLLloa_E3m.jpg" /></figure><p><em>“How easy was airport security today?”</em></p><p><em>“Our waitress was really excellent tonight.”</em></p><p><em>“This project is going really smoothly.”</em></p><p>These anti-complaints did more than realign my perception of the world, though; I started to see the people around me becoming more positive as well, which made for better experiences in both my professional and personal life.</p><h3>Putting Positivity into Practice</h3><p>Being positive doesn’t stop at making you sound less whiny at dinner: <strong>a positive outlook can be the catalyst for huge improvements in all areas of your life.</strong></p><h4>Positivity at Work</h4><p>In a healthy workplace, you’ll be asked for feedback on projects. It’s inevitable that some of that feedback will be negative.</p><p>Just make sure that not <em>all</em> the feedback is negative.</p><p>By taking the time to point out the good things your colleagues are doing, negative feedback will be tempered.</p><p><strong>Without positive feedback, a coworker may feel that you only have negative things to say about her work,</strong> and that can cause tension that just doesn’t need to exist.</p><p>It’s not weak or overly emotional to tell someone you appreciate him. In fact, it’s empowering.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*polkAoIGY3_ZuF2gmFBAzA.jpeg" /><figcaption>My girlfriend Marisa and I at a concert, doing our best to make each other smile.</figcaption></figure><h4>Positivity at Home</h4><p>Every day I tell my girlfriend what makes her special to me. Whether it’s her outfit, something cute she did that put a smile on my face, or just the fact that — to my eternal bewilderment — she still hasn’t thrown all of my things out the window and changed the locks.</p><p>As a result, I can share my frustrations with her without it feeling like the relationship is ruined. We still argue, but those arguments happen with the understanding that we don’t hate each other — we’re just pissed that one of us was supposed to do laundry but instead watched an entire season of <em>The West Wing</em>.</p><h3>Even When It’s Bad, It’s Not That Bad</h3><p>If your partner makes a decision you disagree with, or a colleague shows you a project that you think needs work, <strong>it’s extremely important to remember that very few things are a <em>total</em> failure.</strong></p><p>Try to start by acknowledging the effort that was put in, and listing any positive aspects. Remember whose team you’re on, and that everything can be fixed if you’re working together.</p><p>Next time in you’re in this position, try this experiment: <strong>Don’t look at the project as a failure with salvageable parts; try to see it as a solid effort with room for improvement.</strong></p><h3>Make Sure to Share the Love</h3><p><strong>Positivity works best when it’s shared.</strong></p><p>The people around you can’t read minds, so even if you’re noting all the things they do that you appreciate and admire, they’ll never know it unless you tell them.</p><blockquote>If you make a habit of sharing all the good things, the bad things are easier to hear.</blockquote><p>Imagine a situation where you turn in projects to your boss, and she never says anything. Every project is accepted silently without any feedback.</p><p>Then a project gets rejected. Your boss tells you all the things that are wrong with the project and sends you on your way to fix the problems.</p><p>It doesn’t matter that every project before this one was accepted; <strong>the only feedback you’ve received from her has been negative.</strong></p><p>However, in the exact same situation, if every accepted project had been accompanied with positive feedback — “great job on the layout here”; “I love this sentence here”; “I really appreciate you getting this in on time”<em> — </em>the negative feedback wouldn’t have felt so jarring.</p><p>It would have been feedback as usual, working with you toward a better end product.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/1*Ft1D6MNkZ36AypGzEKL2dg.jpeg" /><figcaption>Richelle, me, and Nate. These two played an integral role in reminding me to stay positive.</figcaption></figure><h3>Life Is Exactly as Good or as Bad as We Choose to Experience It</h3><p>In the year or so since I’ve forced my brain to focus on — and share — the positive things in my life, <strong>I’ve seen a marked improvement in my relationships across the board.</strong> This has led to a better home life, a better workplace, and happier clientele.</p><p>All of these things have improved my happiness, made my business more successful, and (I hope) made me more pleasant to be around.</p><p>It’s important to note that <em>nothing else changed</em> while these improvements were happening. I was living the same life, working the same job, spending my time with the same people.</p><blockquote>The only thing that changed was the lens through which I chose to view my world.</blockquote><h2>Your Turn: List 3 Good Things About Today</h2><p>You can change your life too, starting today. Share your experiences and <strong>tell me 3 good things that happened today:</strong> comment on this post, <a href="https://twitter.com/intent/tweet?url=https://medium.com/@jlengstorf/stop-glossing-over-the-good-stuff-b89e25f7c714&amp;text=1.%20%0D%0A2.%20%0D%0A3.%20%0D%0A%233GoodThings&amp;via=jlengstorf&amp;original_referer=">tweet them</a>, or <a href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fmedium.com%2F%40jlengstorf%2Fstop-glossing-over-the-good-stuff-b89e25f7c714">post them on Facebook</a>.</p><h4>Did you enjoy this post?</h4><p>If this post made you smile, or made you think, or — hopefully — both, <strong>please click the recommend button below.</strong> (Thanks!)</p><p><em>Originally published at </em><a href="http://www.scrawnytobrawny.com/how-to-be-positive"><em>www.scrawnytobrawny.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b89e25f7c714" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Real-Life Truman Show]]></title>
            <link>https://medium.com/project-grownup/the-real-life-truman-show-1cd6b2aa9c34?source=rss-6a98eb806571------2</link>
            <guid isPermaLink="false">https://medium.com/p/1cd6b2aa9c34</guid>
            <dc:creator><![CDATA[Jason Lengstorf]]></dc:creator>
            <pubDate>Fri, 02 May 2014 15:57:31 GMT</pubDate>
            <atom:updated>2014-05-02T15:59:15.930Z</atom:updated>
            <content:encoded><![CDATA[<h4>Why I live like everyone else is watching.</h4><p>In 1998, <a href="http://www.imdb.com/title/tt0120382"><em>The Truman Show</em></a> hit theaters. The plot centers around Jim Carrey’s character, Truman Burbank, who has unwittingly lived his entire life — starting with his birth — in front of millions of people.</p><p>As soon as the credits rolled, I started spotting ideal hiding spots for cameras. I studied the people around me, looking for clues that gave them away as actors.</p><p>I was the real-life Truman Burbank. I could <em>feel</em> it.</p><h4>My Fans Needed a Positive Role Model</h4><p>I was the unwitting star of the world’s most popular reality TV show. The responsibility weighed heavily on me. <strong>I was a <em>role model</em> now.</strong></p><p>The world was a very different place for me post-Truman. My decisions held new significance.</p><p>Would the kids watching at home be damaged by my decisions? If I smoked pot or shoplifted, would I be responsible for ushering in a generation of criminals on a Robocopian scale?</p><p><em>What would my fans think?</em></p><p>Was I a good role model like Matt Damon? Or was I a highly-publicized disaster like Amanda Bynes?</p><p>I started to assume that every action — from losing my virginity to flossing my teeth — was on record. Secrets were not an option; anyone who doubted me could check the tape.</p><h4>How Would You Feel Watching the Replay of This Decision?</h4><p>My life became a carefully considered performance. I had to make sure I wasn’t building a case against myself.</p><p><strong><em>Do I want to watch the replay of myself doing this later?</em></strong></p><p>The phrase “no one will ever know” disappeared from my rhetoric. I was living in public.</p><p>Later, I learned this is called <em>integrity;</em> I called it playing to my audience.</p><h4>Meanwhile, Back in Reality, Actual Lessons Were Learned</h4><p>I did realize, eventually, that I was not the subject of a secretly-filmed reality series. But for all its absurdity, living my life “on camera” resulted — circuitously — in a valuable life lesson:</p><blockquote><strong>Integrity is living every moment like it will be screened for your mom, your lover, and all your Facebook friends.</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3xGvIc0J2c3P6D26h4ATKQ.jpeg" /><figcaption>This is how I make decisions.</figcaption></figure><h4>But, Seriously: I Really Am Living on Camera</h4><p>Hidden cameras or not, I’m always in front of an audience of at least one.</p><p>Blow off going to the gym and make an excuse to watch garbage TV and eat pizza instead? My friends may never find out, but <em>I know</em> I did it. I’ll feel worse about myself privately, which is going to impact how people perceive me publicly.</p><p>The opposite is true as well: if my apartment is trashed and I force myself to clean, I feel a small sense of accomplishment and pride. This starts a small snowball of making good decisions that helps throughout my day; that internal momentum improves outward appearances.</p><blockquote>Every decision is a new scene; I watch myself become a little bit better, or a little bit worse.</blockquote><p>I don’t always get it right, but I make an effort to live my life the way I’d like to watch someone live on film.</p><p>You know. For the fans.</p><p><em>Did this post make you smile, think, or nod in approval? Please consider clicking “Recommend” below — I’d </em><strong><em>really</em></strong><em> appreciate it.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1cd6b2aa9c34" width="1" height="1" alt=""><hr><p><a href="https://medium.com/project-grownup/the-real-life-truman-show-1cd6b2aa9c34">The Real-Life Truman Show</a> was originally published in <a href="https://medium.com/project-grownup">Project Grownup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>