Sha256: e6a1a771ae2e7c2129030f5cd50d7ba5090372e3eadb8d6b417720ff9e34cb05

Contents?: true

Size: 590 Bytes

Versions: 117

Compression:

Stored size: 590 Bytes

Contents

# frozen_string_literal: true
module GraphQL
  class StringEncodingError < GraphQL::RuntimeTypeError
    attr_reader :string, :field, :path
    def initialize(str, context:)
      @string = str
      @field = context[:current_field]
      @path = context[:current_path]
      message = "String #{str.inspect} was encoded as #{str.encoding}".dup
      if @path
        message << " @ #{@path.join(".")}"
      end
      if @field
        message << " (#{@field.path})"
      end
      message << ". GraphQL requires an encoding compatible with UTF-8."
      super(message)
    end
  end
end

Version data entries

117 entries across 117 versions & 2 rubygems

Version Path
graphql-2.1.0 lib/graphql/string_encoding_error.rb
graphql-2.0.27 lib/graphql/string_encoding_error.rb
graphql-2.0.26 lib/graphql/string_encoding_error.rb
graphql-2.0.25 lib/graphql/string_encoding_error.rb
graphql-2.0.24 lib/graphql/string_encoding_error.rb
graphql-2.0.23 lib/graphql/string_encoding_error.rb
graphql-2.0.22 lib/graphql/string_encoding_error.rb
graphql-2.0.21 lib/graphql/string_encoding_error.rb
graphql-2.0.20 lib/graphql/string_encoding_error.rb
graphql-2.0.17.2 lib/graphql/string_encoding_error.rb
graphql-2.0.17.1 lib/graphql/string_encoding_error.rb
graphql-2.0.19 lib/graphql/string_encoding_error.rb
graphql-2.0.18 lib/graphql/string_encoding_error.rb
graphql-2.0.17 lib/graphql/string_encoding_error.rb
graphql-1.13.19 lib/graphql/string_encoding_error.rb
graphql-1.13.18 lib/graphql/string_encoding_error.rb
graphql-2.0.16 lib/graphql/string_encoding_error.rb
graphql-1.13.17 lib/graphql/string_encoding_error.rb
graphql-2.0.15 lib/graphql/string_encoding_error.rb
graphql-2.0.14 lib/graphql/string_encoding_error.rb