Sha256: 28c692900102c710d07c291c5e9f3bf06686dafe18dc75799b9968d2d15cc9af

Contents?: true

Size: 973 Bytes

Versions: 77

Compression:

Stored size: 973 Bytes

Contents

# frozen_string_literal: true
require "graphql/language/block_string"
require "graphql/language/printer"
require "graphql/language/sanitized_printer"
require "graphql/language/document_from_schema_definition"
require "graphql/language/generation"
require "graphql/language/lexer"
require "graphql/language/nodes"
require "graphql/language/cache"
require "graphql/language/parser"
require "graphql/language/token"
require "graphql/language/visitor"
require "graphql/language/definition_slice"

module GraphQL
  module Language
    # @api private
    def self.serialize(value)
      if value.is_a?(Hash)
        serialized_hash = value.map do |k, v|
          "#{k}:#{serialize v}"
        end.join(",")

        "{#{serialized_hash}}"
      elsif value.is_a?(Array)
        serialized_array = value.map do |v|
          serialize v
        end.join(",")

        "[#{serialized_array}]"
      else
        JSON.generate(value, quirks_mode: true)
      end
    end
  end
end

Version data entries

77 entries across 77 versions & 2 rubygems

Version Path
graphql-2.0.31 lib/graphql/language.rb
graphql-1.13.23 lib/graphql/language.rb
graphql-2.0.29 lib/graphql/language.rb
graphql-1.13.22 lib/graphql/language.rb
graphql-2.0.28 lib/graphql/language.rb
graphql-1.13.21 lib/graphql/language.rb
graphql-1.13.20 lib/graphql/language.rb
graphql-2.1.0 lib/graphql/language.rb
graphql-2.0.27 lib/graphql/language.rb
graphql-2.0.26 lib/graphql/language.rb
graphql-2.0.25 lib/graphql/language.rb
graphql-2.0.24 lib/graphql/language.rb
graphql-2.0.23 lib/graphql/language.rb
graphql-2.0.22 lib/graphql/language.rb
graphql-2.0.21 lib/graphql/language.rb
graphql-2.0.20 lib/graphql/language.rb
graphql-2.0.17.2 lib/graphql/language.rb
graphql-2.0.17.1 lib/graphql/language.rb
graphql-2.0.19 lib/graphql/language.rb
graphql-2.0.18 lib/graphql/language.rb