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.11 lib/graphql/string_encoding_error.rb
graphql-2.0.28 lib/graphql/string_encoding_error.rb
graphql-1.13.21 lib/graphql/string_encoding_error.rb
graphql-2.2.5 lib/graphql/string_encoding_error.rb
graphql-2.2.4 lib/graphql/string_encoding_error.rb
graphql-2.2.3 lib/graphql/string_encoding_error.rb
graphql-2.1.10 lib/graphql/string_encoding_error.rb
graphql-2.2.2 lib/graphql/string_encoding_error.rb
graphql-2.1.9 lib/graphql/string_encoding_error.rb
graphql-2.2.1 lib/graphql/string_encoding_error.rb
graphql-2.2.0 lib/graphql/string_encoding_error.rb
graphql-2.1.8 lib/graphql/string_encoding_error.rb
graphql-2.1.7 lib/graphql/string_encoding_error.rb
graphql-2.1.6 lib/graphql/string_encoding_error.rb
graphql-2.1.5 lib/graphql/string_encoding_error.rb
graphql-2.1.4 lib/graphql/string_encoding_error.rb
graphql-1.13.20 lib/graphql/string_encoding_error.rb
graphql-2.1.3 lib/graphql/string_encoding_error.rb
graphql-2.1.2 lib/graphql/string_encoding_error.rb
graphql-2.1.1 lib/graphql/string_encoding_error.rb