module GraphQL::Current

This module exposes Fiber-level runtime information.

It wonโ€™t work across unrelated fibers, although it will work in child Fibers.

Examples

Example: Setting Up ActiveRecord::QueryLogs

config.active_record.query_log_tags = [
  :namespaced_controller,
  :action,
  :job,
  # ...
  {
    # GraphQL runtime info:
    current_graphql_operation: -> { GraphQL::Current.operation_name },
    current_graphql_field: -> { GraphQL::Current.field&.path },
    current_dataloader_source: -> { GraphQL::Current.dataloader_source_class },
    # ...
  },
]