graphql-fragment_cache 0.1.5 → 0.1.6

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: 69226c4789fd364bcd6bf0991ebd358c39a32fee383a8ce7445418d0af46eb04
4
- data.tar.gz: d7a1901dd86a3311f60a02153422044c055ffd46b0297026ab9f434eca1667dd
3
+ metadata.gz: d83b3ff9d3e9cc91b6f013214d2cc4d97c6d2fc8bd377bf38d1f68dd7f935c23
4
+ data.tar.gz: d349157e8c6856c06b5a3ae76915399ae77fc04153093ef9551bb75b45629cb4
5
5
  SHA512:
6
- metadata.gz: 5a22448276b2618d0f85c67aa371fa20828ac24f3f943779d748214214a85d0a55c129b31928e96b904e6e1c8734f4cf5ef32bcb2debf38b9208bfea7fefc29f
7
- data.tar.gz: 17033312f4e5c89c3a135da2c2e12b2980fc5b5582ce22b3089ae1e3b7c0e95de44ca1e19f42cb0a236b6fcd7b6ff9630bb300ee1592d9ec4cf6a759f7e82839
6
+ metadata.gz: 759813c8b9ae4373d9890519aa88573eb9a504771eca25ea7d7ddc2a35b972f172e1fb7e86bbd2f52447886e3c781178cfc7491c9a7257ce436ae411a32395fb
7
+ data.tar.gz: 78c75d761fc3154dd4a4622a36c5b0f7bbc4b26c31eb4bf3e3c6be4423be8ae64923d7207f02217142c213fa80e039410e2d079403c0258efd82543d9866e41d
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 0.1.6 (2020-05-30)
6
+
7
+ - [PR#22](https://github.com/DmitryTsepelev/graphql-ruby-fragment_cache/pull/22) Properly cache entites inside collections ([@DmitryTsepelev][])
8
+
5
9
  ## 0.1.5 (2020-04-28)
6
10
 
7
11
  - [PR#19](https://github.com/DmitryTsepelev/graphql-ruby-fragment_cache/pull/19) Add connections support ([@DmitryTsepelev][])
@@ -124,7 +124,12 @@ module GraphQL
124
124
 
125
125
  def selections_cache_key
126
126
  current_root =
127
- path.reduce(query.lookahead) { |lkhd, name| lkhd.selection_with_alias(name) }
127
+ path.reduce(query.lookahead) { |lkhd, field_name|
128
+ # Handle cached fields inside collections:
129
+ next lkhd if field_name.is_a?(Integer)
130
+
131
+ lkhd.selection_with_alias(field_name)
132
+ }
128
133
 
129
134
  current_root.selections.to_selections_key
130
135
  end
@@ -133,6 +138,9 @@ module GraphQL
133
138
  lookahead = query.lookahead
134
139
 
135
140
  path.map { |field_name|
141
+ # Handle cached fields inside collections:
142
+ next field_name if field_name.is_a?(Integer)
143
+
136
144
  lookahead = lookahead.selection_with_alias(field_name)
137
145
  raise "Failed to look ahead the field: #{field_name}" if lookahead.is_a?(::GraphQL::Execution::Lookahead::NullLookahead)
138
146
 
@@ -1,6 +1,6 @@
1
1
  require "ruby-next"
2
2
 
3
3
  require "ruby-next/language/setup"
4
- RubyNext::Language.setup_gem_load_path
4
+ RubyNext::Language.setup_gem_load_path(transpile: true)
5
5
 
6
6
  require "graphql/fragment_cache"
@@ -124,7 +124,12 @@ module GraphQL
124
124
 
125
125
  def selections_cache_key
126
126
  current_root =
127
- path.reduce(query.lookahead) { |lkhd, name| lkhd.selection_with_alias(name) }
127
+ path.reduce(query.lookahead) { |lkhd, field_name|
128
+ # Handle cached fields inside collections:
129
+ next lkhd if field_name.is_a?(Integer)
130
+
131
+ lkhd.selection_with_alias(field_name)
132
+ }
128
133
 
129
134
  current_root.selections.to_selections_key
130
135
  end
@@ -133,6 +138,9 @@ module GraphQL
133
138
  lookahead = query.lookahead
134
139
 
135
140
  path.map { |field_name|
141
+ # Handle cached fields inside collections:
142
+ next field_name if field_name.is_a?(Integer)
143
+
136
144
  lookahead = lookahead.selection_with_alias(field_name)
137
145
  raise "Failed to look ahead the field: #{field_name}" if lookahead.is_a?(::GraphQL::Execution::Lookahead::NullLookahead)
138
146
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module GraphQL
4
4
  module FragmentCache
5
- VERSION = "0.1.5"
5
+ VERSION = "0.1.6"
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: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - DmitryTsepelev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-28 00:00:00.000000000 Z
11
+ date: 2020-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql
@@ -25,19 +25,19 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.10.8
27
27
  - !ruby/object:Gem::Dependency
28
- name: ruby-next-core
28
+ name: ruby-next
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.5.1
33
+ version: 0.7.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 0.5.1
40
+ version: 0.7.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: combustion
43
43
  requirement: !ruby/object:Gem::Requirement