graphql-fragment_cache 1.4.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dab2cb1f4c27251da27c938bd8a0392f3ad0edcb5c54ba1d7d83d9e2f9c4b12b
4
- data.tar.gz: 8e5323ed6bf476d185c993b8165e292d4d7e70df56fa1ae1ad32da2ae7bc0880
3
+ metadata.gz: 89da5923396f256876f648b15e23b77b14a731b4e5b642fc67074d50fcefc5c3
4
+ data.tar.gz: b4c5a2fe21477726e41835168a8768e8adba9d03d3bf3f618705a31e0ee391a1
5
5
  SHA512:
6
- metadata.gz: 90eebb6973db225980926d330d93ca70a50768279bb727cf702f1bd905628cf7969e1af5025a6fefb1f9785d1fc008fd560d236fbe6315821a6dd2f92243ef56
7
- data.tar.gz: b26090f37a4b20ce45a256880b708c17a77871d8e8f5d95c1b34f171062306332f1bf9a549ab92bce5a326a2327d5b8a4f8106e2b2b4ac338bbd257cec8e6a21
6
+ metadata.gz: 470dc39abc207c3d3db874d1a954d665fadf105c31b3e62ef18bfe0d60ca002e505e7861a52ee2ba652a4789f2c3566c2b7e2134fe22d09ef62b6fe17cf95a7d
7
+ data.tar.gz: ceb3ec4abdf657527aac1e2ca5ab441bb3551a33aefe2fd38c2e1f6cb31e9bbea52b19c9aa30edf10a9e0071593697d4c6cd7f3b9254ad3682a995796375abc4
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 1.4.1 (2021-01-21)
6
+
7
+ - [PR#48](https://github.com/DmitryTsepelev/graphql-ruby-fragment_cache/pull/48) Support graphql-ruby 1.12 ([@DmitryTsepelev][])
8
+
5
9
  ## 1.4.0 (2020-12-03)
6
10
 
7
11
  - [PR#41](https://github.com/DmitryTsepelev/graphql-ruby-fragment_cache/pull/41) Add `keep_in_context` option ([@DmitryTsepelev][])
@@ -23,7 +23,7 @@ module GraphQL
23
23
  attr_reader :cache_store
24
24
 
25
25
  def use(schema_defn, options = {})
26
- verify_interpreter!(schema_defn)
26
+ verify_interpreter_and_analysis!(schema_defn)
27
27
 
28
28
  schema_defn.tracer(Schema::Tracer)
29
29
  schema_defn.instrument(:query, Schema::Instrumentation)
@@ -44,17 +44,33 @@ module GraphQL
44
44
  @cache_store = store
45
45
  end
46
46
 
47
- private
47
+ def graphql_ruby_1_12_or_later?
48
+ Gem::Dependency.new("graphql", ">= 1.12.0").match?("graphql", GraphQL::VERSION)
49
+ end
48
50
 
49
- def verify_interpreter!(schema_defn)
50
- unless schema_defn.interpreter?
51
- raise StandardError,
52
- "GraphQL::Execution::Interpreter should be enabled for fragment caching"
53
- end
51
+ private
54
52
 
55
- unless schema_defn.analysis_engine == GraphQL::Analysis::AST
56
- raise StandardError,
57
- "GraphQL::Analysis::AST should be enabled for fragment caching"
53
+ def verify_interpreter_and_analysis!(schema_defn)
54
+ if graphql_ruby_1_12_or_later?
55
+ unless schema_defn.interpreter?
56
+ raise StandardError,
57
+ "GraphQL::Execution::Execute should not be enabled for fragment caching"
58
+ end
59
+
60
+ unless schema_defn.analysis_engine == GraphQL::Analysis::AST
61
+ raise StandardError,
62
+ "GraphQL::Analysis should not be enabled for fragment caching"
63
+ end
64
+ else
65
+ unless schema_defn.interpreter?
66
+ raise StandardError,
67
+ "GraphQL::Execution::Interpreter should be enabled for fragment caching"
68
+ end
69
+
70
+ unless schema_defn.analysis_engine == GraphQL::Analysis::AST
71
+ raise StandardError,
72
+ "GraphQL::Analysis::AST should be enabled for fragment caching"
73
+ end
58
74
  end
59
75
  end
60
76
  end
@@ -11,9 +11,13 @@ module GraphQL
11
11
  extend Forwardable
12
12
 
13
13
  def self.included(base)
14
- return if base < GraphQL::Execution::Interpreter::HandlesRawValue
14
+ return if base.method_defined?(:raw_value)
15
15
 
16
- base.include(GraphQL::Execution::Interpreter::HandlesRawValue)
16
+ base.include(Module.new {
17
+ def raw_value(obj)
18
+ GraphQL::Execution::Interpreter::RawValue.new(obj)
19
+ end
20
+ })
17
21
  end
18
22
 
19
23
  NO_OBJECT = Object.new
@@ -23,7 +23,7 @@ module GraphQL
23
23
  end
24
24
 
25
25
  def verify_connections!(context)
26
- return if context.schema.new_connections?
26
+ return if GraphQL::FragmentCache.graphql_ruby_1_12_or_later? || context.schema.new_connections?
27
27
 
28
28
  raise StandardError,
29
29
  "GraphQL::Pagination::Connections should be enabled for connection caching"
@@ -2,6 +2,6 @@
2
2
 
3
3
  module GraphQL
4
4
  module FragmentCache
5
- VERSION = "1.4.0"
5
+ VERSION = "1.4.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql-fragment_cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - DmitryTsepelev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-03 00:00:00.000000000 Z
11
+ date: 2021-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql