<commit_before># frozen_string_literal: true

require 'spec_helper'

class FragmentedQuerySpec < PrelaySpec
  let(:album) { Album.first! }

  queries = {
    control: (
      <<-GRAPHQL
        query Query {
          node(id: "%{id}") {
            id,
            ... on Album {
              name,
              upvotes,
              high_quality,
              artist {
                id,
                name,
                upvotes,
                active,
              }
              tracks(first: 50) {
                edges {
                  cursor
                  node {
                    id,
                    name,
                    number,
                    high_quality,
                  }
                }
                pageInfo {
                  hasNextPage
                  hasPreviousPage<commit_msg>Introduce some randomness into the fragment query specs.<commit_after># frozen_string_literal: true

require 'spec_helper'

class FragmentedQuerySpec < PrelaySpec
  let(:album) { Album.order{random{}}.first! }

  queries = {
    control: (
      <<-GRAPHQL
        query Query {
          node(id: "%{id}") {
            id,
            ... on Album {
              name,
              upvotes,
              high_quality,
              artist {
                id,
                name,
                upvotes,
                active,
              }
              tracks(first: 50) {
                edges {
                  cursor
                  node {
                    id,
                    name,
                    number,
                    high_quality,
                  }
                }
                pageInfo {
                  hasNextPage
                  hasPreviousPage
{'fraction_non_alphanumeric': 0.07114170969592656, 'fraction_numerical': 0.002294893861158921, 'mean_word_length': 0.7723577235772358, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, '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': '4422426', 'n_tokens_mistral': 442, 'n_tokens_neox': 403, 'n_words': 86}