Sha256: cdfb637d299b943db15c61245266b76a987b3d96ecad8e35e09990d387138302

Contents?: true

Size: 384 Bytes

Versions: 25

Compression:

Stored size: 384 Bytes

Contents

# frozen_string_literal: true

class Ibrain::LogQueryDepth < GraphQL::Analysis::AST::QueryDepth
  def result
    query_depth = super
    current_user = query.context[:current_user]
    message = <<-RUBY
      [GraphQL Query Depth]: #{query_depth}
      [UserName]: #{current_user.try(:name)}
      [UserID]: #{current_user.try(:id)}
    RUBY

    Rails.logger.info(message)
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
ibrain-core-0.5.15 app/graphql/ibrain/log_query_depth.rb
ibrain-core-0.5.13 app/graphql/ibrain/log_query_depth.rb
ibrain-core-0.5.12 app/graphql/ibrain/log_query_depth.rb
ibrain-core-0.5.10 app/graphql/ibrain/log_query_depth.rb
ibrain-core-0.5.9 app/graphql/ibrain/log_query_depth.rb
ibrain-core-0.5.8 app/graphql/ibrain/log_query_depth.rb
ibrain-core-0.5.7 app/graphql/ibrain/log_query_depth.rb
ibrain-core-0.5.6 app/graphql/ibrain/log_query_depth.rb
ibrain-core-0.5.5 app/graphql/ibrain/log_query_depth.rb
ibrain-core-0.5.4 app/graphql/ibrain/log_query_depth.rb
ibrain-core-0.5.3 app/graphql/ibrain/log_query_depth.rb
ibrain-core-0.5.2 app/graphql/ibrain/log_query_depth.rb
ibrain-core-0.5.1 app/graphql/ibrain/log_query_depth.rb
ibrain-core-0.5.0 app/graphql/ibrain/log_query_depth.rb
ibrain-core-0.4.9 app/graphql/ibrain/log_query_depth.rb
ibrain-core-0.4.8 app/graphql/ibrain/log_query_depth.rb
ibrain-core-0.4.7 app/graphql/ibrain/log_query_depth.rb
ibrain-core-0.4.6 app/graphql/ibrain/log_query_depth.rb
ibrain-core-0.4.5 app/graphql/ibrain/log_query_depth.rb
ibrain-core-0.4.4 app/graphql/ibrain/log_query_depth.rb