rails-graphql 0.2.0 → 0.2.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: f478dece4e018e58e675abb2f4fbff2edb9ad6279db0efae74037f4ed6c7479a
|
4
|
+
data.tar.gz: dc9d08df7234d4d5a833259f3feb95bfc088ed18201b43ebe70c2c62c76b5b40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
#
|
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
|
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
|
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
|
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.
|
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-
|
11
|
+
date: 2021-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|