graphql-models_connect 1.1.0 → 1.1.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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/graphql/models_connect/dsl/graphql/schema/interface.rb +20 -18
- data/lib/graphql/models_connect/version.rb +1 -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: 9dfa2989d064ad1818212ca820d0fcd6a11f6b46ad3f085b2a374e4d7ac989c8
|
4
|
+
data.tar.gz: b321905a5077e7430016a017d65ffc8e7e993db57260d44ee2d6e64a7db3b146
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98821ddcb3874207488965fac1a11d1e639b3d8a35bf31ab76f84e1d244990d7b156b0c271a68b78a988913387c462b137d40a701bab97dcceb6e3a262df0b17
|
7
|
+
data.tar.gz: 8814a689a9c837256d723403c4ef301f7af33662a421efbced5b65b6340ea759b2677d1f93a4903a2f499f0fd96b34ccbf3352ed110c42227051b08c1c55569b
|
data/CHANGELOG.md
CHANGED
@@ -1,25 +1,27 @@
|
|
1
|
-
|
2
|
-
class Schema
|
3
|
-
module Interface
|
4
|
-
definition_methods do
|
5
|
-
def model_class new_model_class=nil
|
6
|
-
if new_model_class.nil?
|
7
|
-
@model_class ||= default_model_class
|
8
|
-
else
|
9
|
-
@model_class = new_model_class
|
10
|
-
end
|
11
|
-
end
|
1
|
+
require 'active_support/concern'
|
12
2
|
|
13
|
-
|
14
|
-
|
3
|
+
monkey_patch = Module.new do
|
4
|
+
extend ActiveSupport::Concern
|
15
5
|
|
16
|
-
|
6
|
+
class_methods do
|
7
|
+
def model_class new_model_class=nil
|
8
|
+
if new_model_class.nil?
|
9
|
+
@model_class ||= default_model_class
|
10
|
+
else
|
11
|
+
@model_class = new_model_class
|
12
|
+
end
|
13
|
+
end
|
17
14
|
|
18
|
-
|
15
|
+
def default_model_class
|
16
|
+
raise 'You must set an explicit model for anonymous graphql interfaces' if name.nil?
|
19
17
|
|
20
|
-
|
21
|
-
|
22
|
-
|
18
|
+
default_model_name = name.delete_suffix 'Type'
|
19
|
+
|
20
|
+
raise "No default model found for #{name}" unless const_defined? default_model_name
|
21
|
+
|
22
|
+
const_get default_model_name
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
26
|
+
|
27
|
+
GraphQL::Schema::Interface.prepend monkey_patch
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql-models_connect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Moku S.r.l.
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2025-
|
12
|
+
date: 2025-05-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|