graphql-metrics 4.0.0 → 4.0.1

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: dbb0d2e1dfd6cf0d08b8c47afedddc2025407dd11c482e07df8e8e86ddbba329
4
- data.tar.gz: 5dfeeb2067df244cf6fe6d755cc6ff0d8995f423ad791f6617cc3368b2d0ac6a
3
+ metadata.gz: 45de407a0b5642ad74d27cdb4ab00635590a38d8b719fc448a3e94d6244d7daf
4
+ data.tar.gz: cae841292ce06f25031974127696594b426b41f469e4f7f74f37f1f3a8c8f521
5
5
  SHA512:
6
- metadata.gz: bf14bbede098cf4dbc7a6a9e4645d29c084655763a6b0ed7d51415f9b2efd62672f45228f6f0b3488fdfd6e4067ac4167c74e11b9abb8d59002ccf8709412737
7
- data.tar.gz: 6c643c41faaf2246fb7770a44f24af71435211652f804f0355c485b7444112e5286763dc43e89bd113694fb887a7507b62952348e5d10cad07417786be9000e0
6
+ metadata.gz: 861b2728422d3f8c314024084497ef761c4ca83491f3967ccffa2d540ced0de524d318a380f7966b6555a539fd30ffdfaec83cafee42f020813875148434f734
7
+ data.tar.gz: 83bde1129c7492cd92ffc097e3072275f179262530a5fccbe6e61b5c485a08bb231a3af8e29ddf88a6f0f3cdfdf5bd7101f0266e042afe37d19232a07195d922
@@ -1,3 +1,8 @@
1
+ 4.0.1
2
+ -----
3
+ - [24](https://github.com/Shopify/graphql-metrics/pull/24) Safely call `arguments_for` to handle arguments which may
4
+ raise `ExecutionError`s in their `prepare` methods.
5
+
1
6
  4.0.0
2
7
  -----
3
8
  - [23](https://github.com/Shopify/graphql-metrics/pull/23) graphql-ruby 1.10.8+ compatibility
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- graphql-metrics (4.0.0)
4
+ graphql-metrics (4.0.1)
5
5
  concurrent-ruby (~> 1.1.0)
6
6
  graphql (>= 1.10.8)
7
7
 
@@ -35,9 +35,16 @@ module GraphQL
35
35
  return if visitor.field_definition.introspection?
36
36
  return if query.context[SKIP_FIELD_AND_ARGUMENT_METRICS]
37
37
 
38
- argument_values = query.arguments_for(node, visitor.field_definition)
38
+ # Arguments can raise execution errors within their `prepare` methods
39
+ # which aren't properly handled during analysis so we have to handle
40
+ # them ourselves safely and return `nil`.
41
+ argument_values = begin
42
+ query.arguments_for(node, visitor.field_definition)
43
+ rescue ::GraphQL::ExecutionError
44
+ nil
45
+ end
39
46
 
40
- extract_arguments(argument_values, visitor.field_definition)
47
+ extract_arguments(argument_values, visitor.field_definition) if argument_values
41
48
 
42
49
  static_metrics = {
43
50
  field_name: node.name,
@@ -2,6 +2,6 @@
2
2
 
3
3
  module GraphQL
4
4
  module Metrics
5
- VERSION = "4.0.0"
5
+ VERSION = "4.0.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql-metrics
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
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-04-29 00:00:00.000000000 Z
11
+ date: 2020-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql