graphql-metrics 3.0.3 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b8eda0da73b10eb0afb49963c3192767df4a711eb4177b401086400167a803c3
4
- data.tar.gz: 1eb7cd4c7a0af088a7686eba62c141dd2530d0efbefc2cc5e954e66d92842130
3
+ metadata.gz: dbb0d2e1dfd6cf0d08b8c47afedddc2025407dd11c482e07df8e8e86ddbba329
4
+ data.tar.gz: 5dfeeb2067df244cf6fe6d755cc6ff0d8995f423ad791f6617cc3368b2d0ac6a
5
5
  SHA512:
6
- metadata.gz: 34ea411c44bec8dd2e0b6e2a613866f5bba29cb6be19984e45c11216b5a154fab7fe459632b483e7d45cc7d082b1fffeb4f744a4cdb91ef0cb0b30c9442c1293
7
- data.tar.gz: 4b9616c41459bddec77ff660063358ee925c819e7c580f9aa068f906482445370900c787d47c3aafd4873322ca38ded57bbc3b8b17605aa695b9e335391e5433
6
+ metadata.gz: bf14bbede098cf4dbc7a6a9e4645d29c084655763a6b0ed7d51415f9b2efd62672f45228f6f0b3488fdfd6e4067ac4167c74e11b9abb8d59002ccf8709412737
7
+ data.tar.gz: 6c643c41faaf2246fb7770a44f24af71435211652f804f0355c485b7444112e5286763dc43e89bd113694fb887a7507b62952348e5d10cad07417786be9000e0
@@ -76,13 +76,6 @@ Style/BlockDelimiters:
76
76
  - proc
77
77
  - it
78
78
 
79
- Style/BracesAroundHashParameters:
80
- EnforcedStyle: no_braces
81
- SupportedStyles:
82
- - braces
83
- - no_braces
84
- - context_dependent
85
-
86
79
  Layout/CaseIndentation:
87
80
  EnforcedStyle: end
88
81
  SupportedStyles:
@@ -509,7 +502,7 @@ Style/WhileUntilModifier:
509
502
  Metrics/BlockNesting:
510
503
  Max: 3
511
504
 
512
- Metrics/LineLength:
505
+ Layout/LineLength:
513
506
  Max: 120
514
507
  AllowHeredoc: true
515
508
  AllowURI: true
@@ -1,3 +1,7 @@
1
+ 4.0.0
2
+ -----
3
+ - [23](https://github.com/Shopify/graphql-metrics/pull/23) graphql-ruby 1.10.8+ compatibility
4
+
1
5
  3.0.3
2
6
  -----
3
7
 
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- graphql-metrics (3.0.2)
4
+ graphql-metrics (4.0.0)
5
5
  concurrent-ruby (~> 1.1.0)
6
- graphql (>= 1.9.5, < 1.10.0)
6
+ graphql (>= 1.10.8)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
@@ -19,8 +19,8 @@ GEM
19
19
  diffy (3.3.0)
20
20
  fakeredis (0.7.0)
21
21
  redis (>= 3.2, < 5.0)
22
- graphql (1.9.19)
23
- graphql-batch (0.4.1)
22
+ graphql (1.10.8)
23
+ graphql-batch (0.4.2)
24
24
  graphql (>= 1.3, < 2)
25
25
  promise.rb (~> 0.7.2)
26
26
  hashdiff (1.0.0)
@@ -30,9 +30,8 @@ Gem::Specification.new do |spec|
30
30
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
31
  spec.require_paths = ["lib"]
32
32
 
33
+ spec.add_runtime_dependency "graphql", ">= 1.10.8"
33
34
  spec.add_runtime_dependency "concurrent-ruby", "~> 1.1.0"
34
- spec.add_runtime_dependency "graphql", ">= 1.9.5", "< 1.10.0"
35
-
36
35
  spec.add_development_dependency "rake", "~> 10.0"
37
36
  spec.add_development_dependency "minitest", "~> 5.0"
38
37
  spec.add_development_dependency 'graphql-batch'
@@ -35,14 +35,14 @@ module GraphQL
35
35
  return if visitor.field_definition.introspection?
36
36
  return if query.context[SKIP_FIELD_AND_ARGUMENT_METRICS]
37
37
 
38
- # NOTE: @rmosolgo "I think it could be reduced to `arguments = visitor.arguments_for(ast_node)`"
39
- arguments = visitor.arguments_for(node, visitor.field_definition)
40
- extract_arguments(arguments.argument_values.values, visitor.field_definition)
38
+ argument_values = query.arguments_for(node, visitor.field_definition)
39
+
40
+ extract_arguments(argument_values, visitor.field_definition)
41
41
 
42
42
  static_metrics = {
43
43
  field_name: node.name,
44
- return_type_name: visitor.type_definition.name,
45
- parent_type_name: visitor.parent_type_definition.name,
44
+ return_type_name: visitor.type_definition.graphql_name,
45
+ parent_type_name: visitor.parent_type_definition.graphql_name,
46
46
  deprecated: visitor.field_definition.deprecation_reason.present?,
47
47
  path: visitor.response_path,
48
48
  }
@@ -93,16 +93,16 @@ module GraphQL
93
93
  argument.each_value do |a|
94
94
  extract_arguments(a, field_defn, parent_input_object)
95
95
  end
96
- when ::GraphQL::Query::Arguments
96
+ when ::GraphQL::Execution::Interpreter::Arguments
97
97
  argument.each_value do |arg_val|
98
98
  extract_arguments(arg_val, field_defn, parent_input_object)
99
99
  end
100
- when ::GraphQL::Query::Arguments::ArgumentValue
100
+ when ::GraphQL::Execution::Interpreter::ArgumentValue
101
101
  extract_argument(argument, field_defn, parent_input_object)
102
102
  extract_arguments(argument.value, field_defn, parent_input_object)
103
103
  when ::GraphQL::Schema::InputObject
104
104
  input_object_argument_values = argument.arguments.argument_values.values
105
- parent_input_object = input_object_argument_values.first&.definition&.metadata&.fetch(:type_class, nil)&.owner
105
+ parent_input_object = input_object_argument_values.first&.definition&.owner
106
106
 
107
107
  extract_arguments(input_object_argument_values, field_defn, parent_input_object)
108
108
  end
@@ -110,10 +110,10 @@ module GraphQL
110
110
 
111
111
  def extract_argument(value, field_defn, parent_input_object = nil)
112
112
  static_metrics = {
113
- argument_name: value.definition.expose_as,
114
- argument_type_name: value.definition.type.unwrap.to_s,
115
- parent_field_name: field_defn.name,
116
- parent_field_type_name: field_defn.metadata[:type_class].owner.graphql_name,
113
+ argument_name: value.definition.graphql_name,
114
+ argument_type_name: value.definition.type.unwrap.graphql_name,
115
+ parent_field_name: field_defn.graphql_name,
116
+ parent_field_type_name: field_defn.owner.graphql_name,
117
117
  parent_input_object_type: parent_input_object&.graphql_name,
118
118
  default_used: value.default_used?,
119
119
  value_is_null: value.value.nil?,
@@ -2,6 +2,6 @@
2
2
 
3
3
  module GraphQL
4
4
  module Metrics
5
- VERSION = "3.0.3"
5
+ VERSION = "4.0.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,49 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql-metrics
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Butcher
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-30 00:00:00.000000000 Z
11
+ date: 2020-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: concurrent-ruby
14
+ name: graphql
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 1.1.0
19
+ version: 1.10.8
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 1.1.0
26
+ version: 1.10.8
27
27
  - !ruby/object:Gem::Dependency
28
- name: graphql
28
+ name: concurrent-ruby
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: 1.9.5
34
- - - "<"
31
+ - - "~>"
35
32
  - !ruby/object:Gem::Version
36
- version: 1.10.0
33
+ version: 1.1.0
37
34
  type: :runtime
38
35
  prerelease: false
39
36
  version_requirements: !ruby/object:Gem::Requirement
40
37
  requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- version: 1.9.5
44
- - - "<"
38
+ - - "~>"
45
39
  - !ruby/object:Gem::Version
46
- version: 1.10.0
40
+ version: 1.1.0
47
41
  - !ruby/object:Gem::Dependency
48
42
  name: rake
49
43
  requirement: !ruby/object:Gem::Requirement