Sha256: 2d5200beae4940352e1af4aa870b2d3a5e7e2d89ff7118c7c752829cfa06ff6a

Contents?: true

Size: 797 Bytes

Versions: 29

Compression:

Stored size: 797 Bytes

Contents

# frozen_string_literal: true
require "graphql/language/definition_slice"
require "graphql/language/generation"
require "graphql/language/lexer"
require "graphql/language/nodes"
require "graphql/language/parser"
require "graphql/language/token"
require "graphql/language/visitor"
require "graphql/language/comments"

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

29 entries across 29 versions & 1 rubygems

Version Path
graphql-1.8.0.pre1 lib/graphql/language.rb
graphql-1.7.6 lib/graphql/language.rb
graphql-1.7.5 lib/graphql/language.rb
graphql-1.7.4 lib/graphql/language.rb
graphql-1.7.3 lib/graphql/language.rb
graphql-1.7.2 lib/graphql/language.rb
graphql-1.7.1 lib/graphql/language.rb
graphql-1.7.0 lib/graphql/language.rb
graphql-1.6.8 lib/graphql/language.rb
graphql-1.6.7 lib/graphql/language.rb
graphql-1.6.6 lib/graphql/language.rb
graphql-1.6.5 lib/graphql/language.rb
graphql-1.6.4 lib/graphql/language.rb
graphql-1.5.15 lib/graphql/language.rb
graphql-1.6.3 lib/graphql/language.rb
graphql-1.6.2 lib/graphql/language.rb
graphql-1.6.1 lib/graphql/language.rb
graphql-1.6.0 lib/graphql/language.rb
graphql-1.5.14 lib/graphql/language.rb
graphql-1.5.13 lib/graphql/language.rb