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.4.3 app/graphql/ibrain/log_query_depth.rb
ibrain-core-0.4.2 app/graphql/ibrain/log_query_depth.rb
ibrain-core-0.4.1 app/graphql/ibrain/log_query_depth.rb
ibrain-core-0.4.0 app/graphql/ibrain/log_query_depth.rb
ibrain-core-0.3.9 app/graphql/ibrain/log_query_depth.rb