graphql-fragment_cache 1.18.2 → 1.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/lib/graphql/fragment_cache/cache_key_builder.rb +1 -1
- data/lib/graphql/fragment_cache/version.rb +1 -1
- data/lib/graphql/fragment_cache.rb +4 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4dd3472ddcbe18e4c306b81770b5a9fa2dbe306968d1e16f2d98e81630bfec8
|
4
|
+
data.tar.gz: 96c8cd920f0e46041c803527bbe3679841daa169aae82db6d627747eaf4632b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c308ffcdfdb6fc7529ec3d094109cf7d21db8380b598435d6274e5b1f89a14110ece6fda565d9bc6429ae907066795597c8815f3e745c9a646033d246b2d1f2d
|
7
|
+
data.tar.gz: 806ef15a72ca9eec45e4cde2e35ba43ceb29194c9ed23d77aa776bd3721a77f4d1b04ae8dc3d189e285be12a3cacd5dd1415faba7f57c745c55cb505eca6322e
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
## 1.19.0 (2023-11-03)
|
6
|
+
|
7
|
+
- [PR#104](https://github.com/DmitryTsepelev/graphql-ruby-fragment_cache/pull/104) Support graphql-ruby 2.1.4 ([@DmitryTsepelev][])
|
8
|
+
|
5
9
|
## 1.18.2 (2023-02-21)
|
6
10
|
|
7
11
|
- [PR#100](https://github.com/DmitryTsepelev/graphql-ruby-fragment_cache/pull/100) Fix an error when `path_cache_key` is nil ([@rince][])
|
data/README.md
CHANGED
@@ -469,7 +469,7 @@ def cached_author_inside_batch
|
|
469
469
|
end
|
470
470
|
```
|
471
471
|
|
472
|
-
2. Caching does not work for Union types, because of the `Lookahead` implementation: it requires the exact type to be passed to the `selection` method (you can find the [discussion](https://github.com/rmosolgo/graphql-ruby/pull/3007) here). This method is used for cache key building, and I haven't found a workaround yet ([PR in progress](https://github.com/DmitryTsepelev/graphql-ruby-fragment_cache/pull/30)). If you get `Failed to look ahead the field` error — please pass `
|
472
|
+
2. Caching does not work for Union types, because of the `Lookahead` implementation: it requires the exact type to be passed to the `selection` method (you can find the [discussion](https://github.com/rmosolgo/graphql-ruby/pull/3007) here). This method is used for cache key building, and I haven't found a workaround yet ([PR in progress](https://github.com/DmitryTsepelev/graphql-ruby-fragment_cache/pull/30)). If you get `Failed to look ahead the field` error — please pass `path_cache_key` explicitly:
|
473
473
|
|
474
474
|
```ruby
|
475
475
|
field :cached_avatar_url, String, null: false
|
@@ -76,7 +76,7 @@ module GraphQL
|
|
76
76
|
arguments = arguments.is_a?(::GraphQL::Execution::Interpreter::Arguments) ? arguments.keyword_arguments : arguments
|
77
77
|
@ast_nodes.each do |ast_node|
|
78
78
|
ast_node.selections.each do |selection|
|
79
|
-
if GraphQL::FragmentCache.graphql_ruby_after_2_0_13?
|
79
|
+
if GraphQL::FragmentCache.graphql_ruby_after_2_0_13? && GraphQL::FragmentCache.graphql_ruby_before_2_1_4?
|
80
80
|
find_selected_nodes(selection, next_field_defn, arguments: arguments, matches: next_nodes)
|
81
81
|
else
|
82
82
|
find_selected_nodes(selection, next_field_name, next_field_defn, arguments: arguments, matches: next_nodes)
|
@@ -65,6 +65,10 @@ module GraphQL
|
|
65
65
|
check_graphql_version "> 2.0.13"
|
66
66
|
end
|
67
67
|
|
68
|
+
def graphql_ruby_before_2_1_4?
|
69
|
+
check_graphql_version "< 2.1.4"
|
70
|
+
end
|
71
|
+
|
68
72
|
private
|
69
73
|
|
70
74
|
def check_graphql_version(predicate)
|
@@ -78,7 +82,6 @@ module GraphQL
|
|
78
82
|
"GraphQL::Execution::Interpreter should be enabled for fragment caching"
|
79
83
|
end
|
80
84
|
|
81
|
-
puts "schema_defn.analysis_engine #{schema_defn.analysis_engine}"
|
82
85
|
unless schema_defn.analysis_engine == GraphQL::Analysis::AST
|
83
86
|
raise StandardError,
|
84
87
|
"GraphQL::Analysis::AST should be enabled for fragment 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
|
+
version: 1.19.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DmitryTsepelev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphql
|