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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89da5923396f256876f648b15e23b77b14a731b4e5b642fc67074d50fcefc5c3
|
4
|
+
data.tar.gz: b4c5a2fe21477726e41835168a8768e8adba9d03d3bf3f618705a31e0ee391a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 470dc39abc207c3d3db874d1a954d665fadf105c31b3e62ef18bfe0d60ca002e505e7861a52ee2ba652a4789f2c3566c2b7e2134fe22d09ef62b6fe17cf95a7d
|
7
|
+
data.tar.gz: ceb3ec4abdf657527aac1e2ca5ab441bb3551a33aefe2fd38c2e1f6cb31e9bbea52b19c9aa30edf10a9e0071593697d4c6cd7f3b9254ad3682a995796375abc4
|
data/CHANGELOG.md
CHANGED
@@ -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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
56
|
-
|
57
|
-
|
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
|
14
|
+
return if base.method_defined?(:raw_value)
|
15
15
|
|
16
|
-
base.include(
|
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"
|
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.
|
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:
|
11
|
+
date: 2021-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphql
|