Sha256: f85be32799253b9fb6d15db85cde436b2412f545ecb48560ba626583db56ed60

Contents?: true

Size: 895 Bytes

Versions: 33

Compression:

Stored size: 895 Bytes

Contents

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

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

33 entries across 33 versions & 1 rubygems

Version Path
graphql-1.8.18 lib/graphql/language.rb
graphql-1.9.21 lib/graphql/language.rb
graphql-1.9.20 lib/graphql/language.rb
graphql-1.9.19 lib/graphql/language.rb
graphql-1.9.18 lib/graphql/language.rb
graphql-1.9.17 lib/graphql/language.rb
graphql-1.9.16 lib/graphql/language.rb
graphql-1.9.15 lib/graphql/language.rb
graphql-1.9.14 lib/graphql/language.rb
graphql-1.10.0.pre1 lib/graphql/language.rb
graphql-1.9.13 lib/graphql/language.rb
graphql-1.9.12 lib/graphql/language.rb
graphql-1.9.11 lib/graphql/language.rb
graphql-1.9.10 lib/graphql/language.rb
graphql-1.9.9 lib/graphql/language.rb
graphql-1.9.8 lib/graphql/language.rb
graphql-1.9.7 lib/graphql/language.rb
graphql-1.9.6 lib/graphql/language.rb
graphql-1.9.5 lib/graphql/language.rb
graphql-1.9.4 lib/graphql/language.rb