graphql-metrics 3.0.1 → 3.0.2

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: cf09941ca4f9ed80c7d1080c6c121fa1cb1ac66ed55735dcb74cec0bbbe3a8a2
4
- data.tar.gz: 18a8b3feafc4bb5be6c065cf05b91da34fee5c826e77d67ad14ea48a23630459
3
+ metadata.gz: 692719d6eddd28987c05a5cf767da34dc2a12a6a697e4525dadb4a4ac655cd3b
4
+ data.tar.gz: 7b06a5ca5ceae870c2dccd75f4b621a12361da07bb7d7269d1171ee9ba177800
5
5
  SHA512:
6
- metadata.gz: 4e11ef76ccd1d038fab97151f40418e5386b5d2d80b45ca1238f5c0ebf60b6a593980bde4efe4fc60c63b3c590bc7da803e8fcb04ce1c9906fa0cf6edecb0e74
7
- data.tar.gz: 32684bc8c1e3fac2e73b4efad7969bb84c38fc34a89510e450e0b423b5ec66104a8cd0fea016b91a47e26299a01df0b09da82597a4fd5dd763d64de4677c04f7
6
+ metadata.gz: 0751a811a26282763ccf624dc12fd55cdfdcda5998c4e955c359aabc4fcc6ad8ed63ff4c66d6ef271054e4541e7930791643f81f76e177ab749b592db07faef8
7
+ data.tar.gz: 54dbdc3529bdb9ace551421653067cc893cab818e0cdc17dc6703046f534901b989e7082bc285d39adb31bf30c334b3c8d0e894b647920a457232b0739ca5be9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ 3.0.2
2
+ -----
3
+
4
+ - [#21](https://github.com/Shopify/graphql-metrics/pull/21) Optimize empty document check
5
+
1
6
  3.0.1
2
7
  -----
3
8
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- graphql-metrics (3.0.1)
4
+ graphql-metrics (3.0.2)
5
5
  concurrent-ruby (~> 1.1.0)
6
6
  graphql (>= 1.9.5, < 1.10.0)
7
7
 
data/README.md CHANGED
@@ -172,9 +172,10 @@ class Schema < GraphQL::Schema
172
172
  use GraphQL::Execution::Interpreter # Required.
173
173
  use GraphQL::Analysis::AST # Required.
174
174
 
175
- instrument :query, GraphQL::Metrics::Instrumentation.new
176
175
  query_analyzer SimpleAnalyzer
177
- tracer GraphQL::Metrics::Tracer.new
176
+
177
+ instrument :query, GraphQL::Metrics::Instrumentation.new # Both of these are required if either is used.
178
+ tracer GraphQL::Metrics::Tracer.new # <-- Note!
178
179
 
179
180
  use GraphQL::Batch # Optional, but highly recommended. See https://github.com/Shopify/graphql-batch/.
180
181
  end
@@ -47,7 +47,9 @@ module GraphQL
47
47
  private
48
48
 
49
49
  def query_present_and_valid?(query)
50
- query.valid? && query.document.to_query_string.present?
50
+ # Check for selected_operation as well for graphql 1.9 compatibility
51
+ # which did not reject "empty" documents in its parser.
52
+ query.valid? && !query.selected_operation.nil?
51
53
  end
52
54
  end
53
55
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module GraphQL
4
4
  module Metrics
5
- VERSION = "3.0.1"
5
+ VERSION = "3.0.2"
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: 3.0.1
4
+ version: 3.0.2
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-16 00:00:00.000000000 Z
11
+ date: 2020-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby