<commit_before>const createReport = require('../../lib');
require('isomorphic-fetch');

createReport({
  template: process.argv[2],
  data: () => {},
});

/*
{
  allFilms {
    edges {
      node {
        title
      }
    }
  }
}
 */<commit_msg>Recover SWAPI example<commit_after>require('isomorphic-fetch');
const createReport = require('../../lib');

createReport({
  template: process.argv[2],
  data: (query) =>
    fetch('http://graphql-swapi.parseapp.com', {
      method: 'POST',
      headers: {
        Accept: 'application/json',
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({ query }),
    })
    .then((res) => res.json())
    .then((res) => res.data),
});

/*
{
  allFilms {
    edges {
      node {
        title
      }
    }
  }
}
 */
{'fraction_non_alphanumeric': 0.2020330368487929, 'fraction_numerical': 0.0025412960609911056, 'mean_word_length': 2.242798353909465, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6923961', 'n_tokens_mistral': 265, 'n_tokens_neox': 263, 'n_words': 42}