Sha256: 912bb76b6389f71ce8611784d9950ee92feabba831d15293d79d6eaed9b1b84b

Contents?: true

Size: 477 Bytes

Versions: 12

Compression:

Stored size: 477 Bytes

Contents

# frozen_string_literal: true

module GraphqlRails
  require 'graphql'

  # base class which is returned in case something bad happens. Contains all error rendering tructure
  class ExecutionError < GraphQL::ExecutionError
    def to_h
      super.merge(extra_graphql_data)
    end

    def extra_graphql_data
      {}.tap do |data|
        data['type'] = type if respond_to?(:type) && type
        data['code'] = type if respond_to?(:code) && code
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
graphql_rails-2.3.0 lib/graphql_rails/errors/execution_error.rb
graphql_rails-2.2.0 lib/graphql_rails/errors/execution_error.rb
graphql_rails-2.1.0 lib/graphql_rails/errors/execution_error.rb
graphql_rails-2.0.0 lib/graphql_rails/errors/execution_error.rb
graphql_rails-1.2.6 lib/graphql_rails/errors/execution_error.rb
graphql_rails-1.2.4 lib/graphql_rails/errors/execution_error.rb
graphql_rails-1.2.3 lib/graphql_rails/errors/execution_error.rb
graphql_rails-1.2.2 lib/graphql_rails/errors/execution_error.rb
graphql_rails-1.2.1 lib/graphql_rails/errors/execution_error.rb
graphql_rails-1.2.0 lib/graphql_rails/errors/execution_error.rb
graphql_rails-1.1.0 lib/graphql_rails/errors/execution_error.rb
graphql_rails-1.0.0 lib/graphql_rails/errors/execution_error.rb