Class: Datadog::AppSec::Contrib::GraphQL::Integration
- Inherits:
-
Object
- Object
- Datadog::AppSec::Contrib::GraphQL::Integration
show all
- Includes:
- Integration
- Defined in:
- lib/datadog/appsec/contrib/graphql/integration.rb
Overview
Description of GraphQL integration
Constant Summary
collapse
- MINIMUM_VERSION =
Gem::Version.new("2.0.19")
- AST_NODE_CLASS_NAMES =
{
field: "GraphQL::Language::Nodes::Field",
directive: "GraphQL::Language::Nodes::Directive",
fragment_spread: "GraphQL::Language::Nodes::FragmentSpread",
variable_identifier: "GraphQL::Language::Nodes::VariableIdentifier",
input_object: "GraphQL::Language::Nodes::InputObject",
}.freeze
Class Method Summary
collapse
Instance Method Summary
collapse
included, register, registry
Class Method Details
.ast_node_classes_defined? ⇒ Boolean
42
43
44
45
46
|
# File 'lib/datadog/appsec/contrib/graphql/integration.rb', line 42
def self.ast_node_classes_defined?
AST_NODE_CLASS_NAMES.all? do |_, class_name|
Object.const_defined?(class_name)
end
end
|
.auto_instrument? ⇒ Boolean
38
39
40
|
# File 'lib/datadog/appsec/contrib/graphql/integration.rb', line 38
def self.auto_instrument?
true
end
|
.compatible? ⇒ Boolean
34
35
36
|
# File 'lib/datadog/appsec/contrib/graphql/integration.rb', line 34
def self.compatible?
!!(super && version&.>=(MINIMUM_VERSION) && ast_node_classes_defined?)
end
|
.loaded? ⇒ Boolean
30
31
32
|
# File 'lib/datadog/appsec/contrib/graphql/integration.rb', line 30
def self.loaded?
!defined?(::GraphQL).nil?
end
|
.version ⇒ Object
26
27
28
|
# File 'lib/datadog/appsec/contrib/graphql/integration.rb', line 26
def self.version
Gem.loaded_specs["graphql"]&.version
end
|
Instance Method Details
#patcher ⇒ Object
48
49
50
|
# File 'lib/datadog/appsec/contrib/graphql/integration.rb', line 48
def patcher
Patcher
end
|