rails-graphql 0.2.0 → 0.2.1

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: 8a4e4946f91fcba1ff47ce9ba25b56af87b2a5652f1d414b4d949b46d8e81bb5
4
- data.tar.gz: dbd510340b18b079ace3237f5ffb9721b752af2795e34e8778c5687dc9d2af1f
3
+ metadata.gz: f478dece4e018e58e675abb2f4fbff2edb9ad6279db0efae74037f4ed6c7479a
4
+ data.tar.gz: dc9d08df7234d4d5a833259f3feb95bfc088ed18201b43ebe70c2c62c76b5b40
5
5
  SHA512:
6
- metadata.gz: df0dbeb5e6d27955c328d7f1c7051324ca47f71e279df2fa0e927cf0d9af0b150c33c209fa1fd3fc09701ce5e0df0137e88c8faff04bf602bc798dd2eda4ea71
7
- data.tar.gz: 03f61e059ebea710f08d22452dc736d35efae12174b3a74aff67490fee80b8edf08124f2b17f43656f525b893a548b2c99ff2607dc5442059fa2ab6fef71ca4e
6
+ metadata.gz: f532b284a2e9af983f8406d570b3b0dabaf017d588de1c211709536a7fbca3450d5ca0fc9850ffb5fd191e022d989b900111be1a347db41abfb40b5958f05cb1
7
+ data.tar.gz: 2465ad648d17fc618545fef5931c12add940805c35733d2424589c50dc14d2e9c4ae4620613ba8fc3f3e46eaaa34d1524fd9b18a2bb4ff05a0fc7b02139dd0d3
@@ -54,14 +54,16 @@ module Rails # :nodoc:
54
54
  # Ignores the possible errors here related
55
55
  end
56
56
 
57
- # After a successfully registration, add the assigned class to the
58
- # type map as a great alias to find the object
57
+ # After a successfully registration, add the assigned class to the type
58
+ # map as a great alias to find the object, but only if the class does
59
+ # not have an alias already
59
60
  def register!
60
61
  return if abstract?
61
62
  return super unless assigned?
62
63
 
63
64
  result = super
64
65
  return result unless (klass = safe_assigned_class)
66
+ return result if GraphQL.type_map.exist?(klass, namespaces: namespaces)
65
67
 
66
68
  GraphQL.type_map.register_alias(klass, namespaces: namespaces, &method(:itself))
67
69
  result
@@ -91,7 +91,7 @@ module Rails
91
91
  def build_reflection_fields(holder)
92
92
  each_reflection(holder) do |item|
93
93
  next if holder.field?(item.name)
94
- type_map_after_register(item.klass.name) do |type|
94
+ type_map_after_register(item.klass) do |type|
95
95
  next unless (type.object? && type.try(:assigned_to) != item.klass) ||
96
96
  type.interface?
97
97
 
@@ -100,7 +100,7 @@ module Rails # :nodoc:
100
100
  next if model.base_class == model
101
101
 
102
102
  # TODO: Allow nested inheritance for setting up implementation
103
- type_map_after_register(model.base_class.name) do |type|
103
+ type_map_after_register(model.base_class) do |type|
104
104
  object.implements(type) if type.interface?
105
105
  end
106
106
  end
@@ -252,7 +252,7 @@ module Rails # :nodoc:
252
252
  position = callbacks[name_or_key].size
253
253
 
254
254
  callbacks[name_or_key] << ->(n, b, result) do
255
- return unless b === base_class && namespaces.include?(n)
255
+ return unless b === base_class && (n === :base || namespaces.include?(n))
256
256
  block.call(result)
257
257
  position
258
258
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rails # :nodoc:
4
4
  module GraphQL # :nodoc:
5
- VERSION = '0.2.0'
5
+ VERSION = '0.2.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-graphql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Silva
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-08 00:00:00.000000000 Z
11
+ date: 2021-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails