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.4.4 lib/graphql/string_encoding_error.rb
graphql-2.4.3 lib/graphql/string_encoding_error.rb
graphql-2.4.2 lib/graphql/string_encoding_error.rb
graphql-2.4.1 lib/graphql/string_encoding_error.rb
graphql-2.4.0 lib/graphql/string_encoding_error.rb
graphql-2.3.20 lib/graphql/string_encoding_error.rb
graphql-2.3.19 lib/graphql/string_encoding_error.rb
graphql-2.3.18 lib/graphql/string_encoding_error.rb
graphql-2.3.17 lib/graphql/string_encoding_error.rb
graphql-2.3.16 lib/graphql/string_encoding_error.rb
graphql-2.3.15 lib/graphql/string_encoding_error.rb
graphql-2.3.14 lib/graphql/string_encoding_error.rb
graphql-2.3.13 lib/graphql/string_encoding_error.rb
graphql-2.3.12 lib/graphql/string_encoding_error.rb
graphql-2.3.11 lib/graphql/string_encoding_error.rb
graphql-2.3.10 lib/graphql/string_encoding_error.rb
graphql-2.2.16 lib/graphql/string_encoding_error.rb
graphql-2.1.13 lib/graphql/string_encoding_error.rb
graphql-2.3.9 lib/graphql/string_encoding_error.rb
graphql-2.3.8 lib/graphql/string_encoding_error.rb