Class: GraphQLMetrics::Extractor
- Inherits:
-
Object
- Object
- GraphQLMetrics::Extractor
show all
- Defined in:
- lib/graphql_metrics/extractor.rb
Defined Under Namespace
Classes: DummyInstrumentor
Constant Summary
collapse
- EXPLICIT_NULL =
'EXPLICIT_NULL'
- IMPLICIT_NULL =
'IMPLICIT_NULL'
- NON_NULL =
'NON_NULL'
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(instrumentor = DummyInstrumentor.new) ⇒ Extractor
Returns a new instance of Extractor.
25
26
27
|
# File 'lib/graphql_metrics/extractor.rb', line 25
def initialize(instrumentor = DummyInstrumentor.new)
@instrumentor = instrumentor
end
|
Instance Attribute Details
#query ⇒ Object
Returns the value of attribute query.
23
24
25
|
# File 'lib/graphql_metrics/extractor.rb', line 23
def query
@query
end
|
Instance Method Details
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
# File 'lib/graphql_metrics/extractor.rb', line 33
def (query)
@query = query
return unless query.valid?
return unless query.irep_selection
used_variables =
query.operations.each_value do |operation|
(operation, used_variables)
end
(query.irep_selection)
end
|
51
52
53
54
55
56
57
58
59
60
|
# File 'lib/graphql_metrics/extractor.rb', line 51
def
[self, instrumentor].any? do ||
.respond_to?(:query_extracted) ||
.respond_to?(:field_extracted) ||
.respond_to?(:argument_extracted) ||
.respond_to?(:variable_extracted) ||
.respond_to?(:batch_loaded_field_extracted) ||
.respond_to?(:before_query_extracted)
end
end
|
#handle_extraction_exception(ex) ⇒ Object
62
63
64
|
# File 'lib/graphql_metrics/extractor.rb', line 62
def handle_extraction_exception(ex)
raise ex
end
|
#instrumentor ⇒ Object
29
30
31
|
# File 'lib/graphql_metrics/extractor.rb', line 29
def instrumentor
@instrumentor ||= DummyInstrumentor.new
end
|