souls 0.65.2 → 0.66.0
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/lib/souls/cli/generate/mutation.rb +6 -6
- data/lib/souls/cli/generate/mutation_rbs.rb +17 -4
- data/lib/souls/cli/generate/type_rbs.rb +1 -1
- data/lib/souls/version.rb +1 -1
- data/lib/souls/versions/.souls_api_version +1 -1
- data/lib/souls/versions/.souls_worker_version +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: badff53370c04ff529c865e90e33f7fffd0f046759027d917992fdb868e50782
|
4
|
+
data.tar.gz: edd9677f32e2cdb62f507da4807bc659e63c15c0293701349be5a760572f0f93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7bb2bd4099d1aab172120a713b6a9ab1cf3b22911072e52cf3964705d310c214757cdfbb6d35f33c1649bc52128f490c2c51294ae871c2d362a55da40944964
|
7
|
+
data.tar.gz: 71e553091f8ec4368eebb66243e4e9878c39f633a3e6c036b0141fa225c8d16f157e74b9367b5ae402ef680a8e66efbb6f3cf48a42765d4a1769ac02abb84be8
|
@@ -45,7 +45,7 @@ module Souls
|
|
45
45
|
type = Souls.type_check(param[:type])
|
46
46
|
type = "[#{type}]" if param[:array]
|
47
47
|
type = "String" if param[:column_name].match?(/$*_id\z/)
|
48
|
-
next if
|
48
|
+
next if param[:column_name] == "user_id"
|
49
49
|
|
50
50
|
if i == params[:params].size - 1
|
51
51
|
f.write(" argument :#{param[:column_name]}, #{type}, required: false\n\n")
|
@@ -116,11 +116,12 @@ module Souls
|
|
116
116
|
type = Souls.type_check(param[:type])
|
117
117
|
type = "[#{type}]" if param[:array]
|
118
118
|
type = "String" if param[:column_name].match?(/$*_id\z/)
|
119
|
-
next if
|
119
|
+
next if param[:column_name] == "user_id"
|
120
120
|
|
121
121
|
if i == params[:params].size - 1
|
122
122
|
f.write(" argument :#{param[:column_name]}, #{type}, required: false\n\n")
|
123
123
|
f.write(" def resolve(args)\n")
|
124
|
+
f.write(" _, data_id = SoulsApiSchema.from_global_id(args[:id])\n")
|
124
125
|
else
|
125
126
|
f.write(" argument :#{param[:column_name]}, #{type}, required: false\n")
|
126
127
|
end
|
@@ -140,12 +141,11 @@ module Souls
|
|
140
141
|
", #{n[:column_name]}: #{n[:column_name]}"
|
141
142
|
end
|
142
143
|
f.write(" new_record = { **args #{relation_params.compact.join} }\n")
|
143
|
-
f.write(" data = ::#{singularized_class_name.camelize}.find(article_id)\n")
|
144
|
-
f.write(" data.update(new_record)\n")
|
145
144
|
else
|
146
|
-
f.write("
|
147
|
-
f.write(" data.update(args)\n")
|
145
|
+
f.write(" new_record = args.except(:id)\n")
|
148
146
|
end
|
147
|
+
f.write(" data = ::#{singularized_class_name.camelize}.find(data_id)\n")
|
148
|
+
f.write(" data.update(new_record)\n")
|
149
149
|
end
|
150
150
|
File.open(file_path, "a") do |new_line|
|
151
151
|
new_line.write(<<~TEXT)
|
@@ -61,7 +61,11 @@ module Souls
|
|
61
61
|
rbs_type = Souls.rbs_type_check(param[:type])
|
62
62
|
type = "[#{type}]" if param[:array]
|
63
63
|
if i.zero?
|
64
|
-
|
64
|
+
if param[:column_name].match?(/$*_id\z/)
|
65
|
+
f.write(" def self.argument: (:#{param[:column_name]}, String, required: false ) -> #{rbs_type}\n")
|
66
|
+
else
|
67
|
+
f.write(" def self.argument: (:#{param[:column_name]}, #{type}, required: false ) -> #{rbs_type}\n")
|
68
|
+
end
|
65
69
|
elsif param[:column_name].match?(/$*_id\z/)
|
66
70
|
f.write(" | (:#{param[:column_name]}, String, required: false ) -> String\n")
|
67
71
|
else
|
@@ -114,9 +118,11 @@ module Souls
|
|
114
118
|
TEXT
|
115
119
|
end
|
116
120
|
File.open(file_path, "a") do |f|
|
117
|
-
params[:params].
|
121
|
+
cols = params[:params].reject { |n| n[:column_name] == "user_id" }
|
122
|
+
cols.each_with_index do |param, i|
|
118
123
|
type = Souls.rbs_type_check(param[:type])
|
119
124
|
type = "[#{type}]" if param[:array]
|
125
|
+
|
120
126
|
if i == params[:params].size - 1
|
121
127
|
f.write(" #{param[:column_name]}: #{type}?\n")
|
122
128
|
else
|
@@ -131,13 +137,20 @@ module Souls
|
|
131
137
|
# rubocop:enable Layout/LineLength
|
132
138
|
|
133
139
|
File.open(file_path, "a") do |f|
|
134
|
-
params[:params].
|
140
|
+
cols = params[:params].reject { |n| n[:column_name] == "user_id" }
|
141
|
+
cols.each_with_index do |param, i|
|
135
142
|
type = Souls.type_check(param[:type])
|
136
143
|
rbs_type = Souls.rbs_type_check(param[:type])
|
137
144
|
type = "[#{type}]" if param[:array]
|
145
|
+
|
138
146
|
required = param[:column_name] == "id" ? "required: true" : "required: false"
|
139
147
|
if i.zero?
|
140
|
-
|
148
|
+
if param[:column_name].match?(/$*_id\z/)
|
149
|
+
f.write(" def self.argument: (:#{param[:column_name]}, String, #{required} ) -> String\n")
|
150
|
+
else
|
151
|
+
f.write(" def self.argument: (:#{param[:column_name]}, #{type}, #{required} ) -> #{rbs_type}\n")
|
152
|
+
end
|
153
|
+
|
141
154
|
else
|
142
155
|
f.write(" | (:#{param[:column_name]}, #{type}, #{required} ) -> #{rbs_type}\n")
|
143
156
|
end
|
@@ -25,7 +25,7 @@ module Souls
|
|
25
25
|
type = "[#{type}]" if param[:array]
|
26
26
|
rbs_type = Souls.rbs_type_check(param[:type])
|
27
27
|
if i.zero?
|
28
|
-
if
|
28
|
+
if param[:column_name].match?(/$*_id\z/)
|
29
29
|
col_name = param[:column_name].gsub("_id", "")
|
30
30
|
f.write(" def self.field: (:#{col_name}, untyped, null: false) -> untyped\n")
|
31
31
|
else
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.45.0
|
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.45.0
|