graphiti_gql 0.2.30 → 0.2.31

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: a02dc0813b461497979a165c77f9116922559c46a54ba26a5130e31832c4bcef
4
- data.tar.gz: 60a27d5d31c31a39d062d1a65a2c0278ce3ea6f3cba3c4900ed1332525a54460
3
+ metadata.gz: ba3f305f68fc23193bb245eff566feb18eaec47a775c5f0fdab8177707b564f8
4
+ data.tar.gz: 3f96b0cee52d9aa3c3968f125487d26f85f6bdb7acc13c2d457a2bc4feb65e11
5
5
  SHA512:
6
- metadata.gz: e2a9a66b5dd624962bfffdc733115f8cf0363846db434bf9dfbe76374cd94dd0b9411ccf2aa93ce543a144ad0505e9f8d1e39bcb34b5593a7f870e17d7f13440
7
- data.tar.gz: eb5004a261e6b7b815eb16ab548591c27beda1231e0875103c75d059c885ed2311b7d8c2b4d1a651d08905facdb8478b328eb5f78ec0fb812dab8cfc5f175583
6
+ metadata.gz: c05e7c4dc7b7908a1b3f43b40cba6b5bcf6bbda4c2b26be4555783a4d27018e249e22d1e3feb8e1d0df09e35b62fc0f98759f4d0e9b16edc9725199dd79d19dc
7
+ data.tar.gz: '049cb6c5201efa3a6921c5e964dbb7064dc70a7d5930c480bcf59b9466d839779a11c41a7d66cc7434d778ed200a94c0fc75a6736ff4b38817d453788cfc8318'
data/.gitignore CHANGED
@@ -9,3 +9,5 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+
13
+ Gemfile.lock
@@ -20,7 +20,7 @@ module GraphitiGql
20
20
  ids.compact!
21
21
  return if ids.empty?
22
22
 
23
- if @params[:simpleid]
23
+ if @params[:simpleid] && !to_polymorphic_resource?
24
24
  if @sideload.type == :polymorphic_belongs_to
25
25
  ids.each do |id|
26
26
  child = @sideload.children.values.find { |c| c.group_name == id[:type].to_sym }
@@ -55,8 +55,9 @@ module GraphitiGql
55
55
  end
56
56
  values = futures.map(&:value)
57
57
  ids.each do |id|
58
- val = values.find { |v| v[:type] == id[:type] }
59
- fulfill(id, val[:data][0])
58
+ records_for_type = values.find { |v| v[:type] == id[:type] }
59
+ corresponding = records_for_type[:data].find { |r| r.id == id[:id] }
60
+ fulfill(id, corresponding)
60
61
  end
61
62
  else
62
63
  resource = Schema.registry.get(@sideload.resource.class)[:resource]
@@ -74,6 +75,12 @@ module GraphitiGql
74
75
  end
75
76
  end
76
77
  end
78
+
79
+ private
80
+
81
+ def to_polymorphic_resource?
82
+ @sideload.resource.polymorphic? && @sideload.type != :polymorphic_belongs_to
83
+ end
77
84
  end
78
85
  end
79
86
  end
@@ -1,3 +1,3 @@
1
1
  module GraphitiGql
2
- VERSION = "0.2.30"
2
+ VERSION = "0.2.31"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphiti_gql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.30
4
+ version: 0.2.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Richmond
@@ -126,7 +126,6 @@ files:
126
126
  - ".rspec"
127
127
  - ".travis.yml"
128
128
  - Gemfile
129
- - Gemfile.lock
130
129
  - LICENSE.txt
131
130
  - README.md
132
131
  - Rakefile
data/Gemfile.lock DELETED
@@ -1,94 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- graphiti_gql (0.2.29)
5
- activemodel (> 6.0, < 8.0)
6
- graphiti (~> 1.3.9)
7
- graphql (~> 2.0)
8
- graphql-batch (~> 0.5)
9
-
10
- GEM
11
- remote: https://rubygems.org/
12
- specs:
13
- activemodel (7.0.3)
14
- activesupport (= 7.0.3)
15
- activesupport (7.0.3)
16
- concurrent-ruby (~> 1.0, >= 1.0.2)
17
- i18n (>= 1.6, < 2)
18
- minitest (>= 5.1)
19
- tzinfo (~> 2.0)
20
- byebug (11.1.3)
21
- coderay (1.1.3)
22
- concurrent-ruby (1.1.10)
23
- diff-lcs (1.5.0)
24
- dry-container (0.10.1)
25
- concurrent-ruby (~> 1.0)
26
- dry-core (0.8.1)
27
- concurrent-ruby (~> 1.0)
28
- dry-inflector (0.3.0)
29
- dry-logic (1.2.0)
30
- concurrent-ruby (~> 1.0)
31
- dry-core (~> 0.5, >= 0.5)
32
- dry-types (1.5.1)
33
- concurrent-ruby (~> 1.0)
34
- dry-container (~> 0.3)
35
- dry-core (~> 0.5, >= 0.5)
36
- dry-inflector (~> 0.1, >= 0.1.2)
37
- dry-logic (~> 1.0, >= 1.0.2)
38
- graphiti (1.3.9)
39
- activesupport (>= 5.2)
40
- concurrent-ruby (~> 1.0)
41
- dry-types (>= 0.15.0, < 2.0)
42
- graphiti_errors (~> 1.1.0)
43
- jsonapi-renderer (~> 0.2, >= 0.2.2)
44
- jsonapi-serializable (~> 0.3.0)
45
- graphiti_errors (1.1.2)
46
- jsonapi-serializable (~> 0.1)
47
- graphql (2.0.12)
48
- graphql-batch (0.5.1)
49
- graphql (>= 1.10, < 3)
50
- promise.rb (~> 0.7.2)
51
- i18n (1.12.0)
52
- concurrent-ruby (~> 1.0)
53
- jsonapi-renderer (0.2.2)
54
- jsonapi-serializable (0.3.1)
55
- jsonapi-renderer (~> 0.2.0)
56
- method_source (1.0.0)
57
- minitest (5.16.2)
58
- promise.rb (0.7.4)
59
- pry (0.13.1)
60
- coderay (~> 1.1)
61
- method_source (~> 1.0)
62
- pry-byebug (3.9.0)
63
- byebug (~> 11.0)
64
- pry (~> 0.13.0)
65
- rake (10.5.0)
66
- rspec (3.11.0)
67
- rspec-core (~> 3.11.0)
68
- rspec-expectations (~> 3.11.0)
69
- rspec-mocks (~> 3.11.0)
70
- rspec-core (3.11.0)
71
- rspec-support (~> 3.11.0)
72
- rspec-expectations (3.11.0)
73
- diff-lcs (>= 1.2.0, < 2.0)
74
- rspec-support (~> 3.11.0)
75
- rspec-mocks (3.11.1)
76
- diff-lcs (>= 1.2.0, < 2.0)
77
- rspec-support (~> 3.11.0)
78
- rspec-support (3.11.0)
79
- tzinfo (2.0.5)
80
- concurrent-ruby (~> 1.0)
81
-
82
- PLATFORMS
83
- arm64-darwin-21
84
-
85
- DEPENDENCIES
86
- bundler (~> 2.3)
87
- graphiti_gql!
88
- pry
89
- pry-byebug
90
- rake (~> 10.0)
91
- rspec (~> 3.0)
92
-
93
- BUNDLED WITH
94
- 2.3.12