Sha256: 2f0ade80bf15f6d76f81b65301c4123403b3efa55df882657ae1d87dd3d9dbe6

Contents?: true

Size: 1015 Bytes

Versions: 29

Compression:

Stored size: 1015 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/static_visitor"
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

29 entries across 29 versions & 1 rubygems

Version Path
graphql-2.2.16 lib/graphql/language.rb
graphql-2.1.13 lib/graphql/language.rb
graphql-2.2.14 lib/graphql/language.rb
graphql-2.2.13 lib/graphql/language.rb
graphql-2.2.12 lib/graphql/language.rb
graphql-2.1.12 lib/graphql/language.rb
graphql-2.2.11 lib/graphql/language.rb
graphql-2.2.10 lib/graphql/language.rb
graphql-2.2.9 lib/graphql/language.rb
graphql-2.2.8 lib/graphql/language.rb
graphql-2.2.7 lib/graphql/language.rb
graphql-2.2.6 lib/graphql/language.rb
graphql-2.1.11 lib/graphql/language.rb
graphql-2.2.5 lib/graphql/language.rb
graphql-2.2.4 lib/graphql/language.rb
graphql-2.2.3 lib/graphql/language.rb
graphql-2.1.10 lib/graphql/language.rb
graphql-2.2.2 lib/graphql/language.rb
graphql-2.1.9 lib/graphql/language.rb
graphql-2.2.1 lib/graphql/language.rb