title: UnhandledPromiseRejectionWarning: Unhandled promise rejection - API
body: <p>I'm trying to extract data from an API, but I'm getting an unsuccessful exit when I add updatedSince: <code>\ "2020-01-01T00: 00: 00-0300 \"</code></p>
  
  <p>Without this parameter the array is returned, but it doesn't have the data I want</p>
  
  <p><strong>index.js</strong></p>
  
  <pre><code>require('es6-promise').polyfill();
  require('isomorphic-fetch');
  
  fetch('https://www.bluesight.io/graphql', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json',
                 'Bluesight-API-Token': 'api-token-here'},
      body: JSON.stringify({"query": "{squads {name cards(includedOnKanban: true, closed: false, archived: false, cancelled: false, updatedSince: \"2020-01-01T00:00:00-0300\") {identifier title description status priority assignees { fullname email } secondaryLabel primaryLabels}}}"}),})           
  
  .then(function(response) {
  
      if (response.status &gt;= 400) {
  
          return Promise.reject('Oops!').catch(err =&gt; {
              throw new Error(err);
            });
  
      }else{
  
          console.log("Method: POST\nContent-Type: application/json\nBluesight-API-Token: OK\nQuery: OK");
          response.json();
  
      }
  
      return response.text();
  })
  
  .then(response =&gt; console.log(response.data));
  </code></pre>
  
  <p><strong>OUTPUT</strong></p>
  
  <pre><code>PS C:\Users\Documents\Bluesight&gt; node .\index.js
  (node:12444) UnhandledPromiseRejectionWarning: Error: Oops!
      at C:\Users\Documents\Bluesight\index.js:15:19
  (node:12444) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)
  (node:12444) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
  PS C:\Users\Documents\Bluesight&gt; node .\index.js
  (node:20236) UnhandledPromiseRejectionWarning: Error: Oops!
      at C:\Users\Documents\Bluesight\index.js:15:19
      at processTicksAndRejections (internal/process/task_queues.js:97:5)
  (node:20236) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)
  (node:20236) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
  </code></pre>
  
  <p><strong>POSTMAN</strong></p>
  
  <p><a href="https://i.stack.imgur.com/USYzo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/USYzo.png" alt="enter image description here"></a></p>