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.0.0 lib/graphql/string_encoding_error.rb
graphql-1.13.9 lib/graphql/string_encoding_error.rb
graphql-1.12.24 lib/graphql/string_encoding_error.rb
graphql-1.13.8 lib/graphql/string_encoding_error.rb
graphql-1.13.7 lib/graphql/string_encoding_error.rb
graphql-1.13.6 lib/graphql/string_encoding_error.rb
graphql-1.13.5 lib/graphql/string_encoding_error.rb
graphql-1.13.4 lib/graphql/string_encoding_error.rb
graphql-1.13.3 lib/graphql/string_encoding_error.rb
graphql-1.12.23 lib/graphql/string_encoding_error.rb
graphql-1.13.2 lib/graphql/string_encoding_error.rb
graphql-1.13.1 lib/graphql/string_encoding_error.rb
graphql-1.12.22 lib/graphql/string_encoding_error.rb
graphql-1.13.0 lib/graphql/string_encoding_error.rb
graphql-1.12.21 lib/graphql/string_encoding_error.rb
graphql-1.12.20 lib/graphql/string_encoding_error.rb
graphql-1.12.19 lib/graphql/string_encoding_error.rb