graphql_scaffold_fan 0.2.6 → 0.2.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/generators/graphql_scaffold/mutation_generator.rb +1 -8
- data/lib/generators/graphql_scaffold/type_generator.rb +4 -2
- data/lib/generators/templates/mutation_create_test.haml +0 -1
- data/lib/generators/templates/mutation_delete_test.haml +0 -2
- data/lib/generators/templates/mutation_update_test.haml +0 -1
- data/lib/generators/templates/query_test.haml +1 -1
- data/lib/graphql_scaffold_fan/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: 9ba9d72db1f0fb0c651d27bc1921d51c2faba8cc256bf48619083d3c3759e43c
|
4
|
+
data.tar.gz: 14479b75e45e7d5db5a76d88018e57d85f0c9ad2385a45a3c3520004aad91b8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75995831b11640fe0ba5fe8d308692b1f4366b51654bebe9517882239414b58bb1c2de4dd8185fe694804c8aca9ba97d41c475950ad0d2d526d82c2ca95061dd
|
7
|
+
data.tar.gz: 02442d7ad6976caeba210601d0a8883d50d6b50afacf0f6084fd168a138f8ea35ca11dceb71914d932923820f49f6e76f9983e03815f8781947e5e108d37ab9f
|
data/Gemfile.lock
CHANGED
@@ -22,7 +22,7 @@ module GraphqlScaffold
|
|
22
22
|
generator_dir_path = admin_mutation_dir_path + ("/#{@module_name.underscore}" if @module_name.present?).to_s
|
23
23
|
@generator_path = generator_dir_path + "/#{file_name}s"
|
24
24
|
|
25
|
-
admin_mutation_test_dir_path = 'spec/
|
25
|
+
admin_mutation_test_dir_path = 'spec/requests/mutations/admin'
|
26
26
|
generator_test_dir_path = admin_mutation_test_dir_path + (if @module_name.present?
|
27
27
|
"/#{@module_name.underscore}"
|
28
28
|
end).to_s
|
@@ -122,13 +122,6 @@ module GraphqlScaffold
|
|
122
122
|
template 'mutation_type.haml', generator_path
|
123
123
|
end
|
124
124
|
end
|
125
|
-
|
126
|
-
def create_test_file
|
127
|
-
test_dir_path = 'spec/requests/mutations'
|
128
|
-
test_file_path = test_dir_path + "/#{file_name}_spec.rb"
|
129
|
-
FileUtils.mkdir_p(test_dir_path) unless File.exist?(test_dir_path)
|
130
|
-
template 'mutation_test.haml', test_file_path
|
131
|
-
end
|
132
125
|
end
|
133
126
|
end
|
134
127
|
end
|
@@ -11,10 +11,12 @@ module GraphqlScaffold
|
|
11
11
|
dst_dir = 'app/graphql/types/admin'
|
12
12
|
if File.exist?("app/graphql/types/#{file_name}_type.rb")
|
13
13
|
FileUtils.mv(src_file, dst_dir)
|
14
|
+
p "Move #{file_name}_type.rb location"
|
14
15
|
file = File.open("#{dst_dir}/#{file_name}_type.rb")
|
15
16
|
file_data = file.read
|
16
|
-
new_file_data = file_data.insert(
|
17
|
+
new_file_data = file_data.insert(52, 'Admin::')
|
17
18
|
File.write(file, new_file_data)
|
19
|
+
p "Write to #{file_name}_type.rb"
|
18
20
|
else
|
19
21
|
p "can not find #{file_name}_type file to move"
|
20
22
|
end
|
@@ -67,7 +69,7 @@ module GraphqlScaffold
|
|
67
69
|
end
|
68
70
|
|
69
71
|
def create_test_file
|
70
|
-
test_dir_path = 'spec/requests/queries'
|
72
|
+
test_dir_path = 'spec/requests/queries/admin'
|
71
73
|
test_file_path = test_dir_path + "/#{file_name}_spec.rb"
|
72
74
|
FileUtils.mkdir_p(test_dir_path) unless File.exist?(test_dir_path)
|
73
75
|
template 'query_test.haml', test_file_path
|
@@ -13,7 +13,6 @@ RSpec.describe Mutations::Admin::<%= class_name %>s::Create<%= class_name %>, ty
|
|
13
13
|
GQL
|
14
14
|
|
15
15
|
expect do
|
16
|
-
sign_in admin_user
|
17
16
|
post '/api/admin/graphql', headers: admin_user.create_new_auth_token, params: { query: query, variables: variables }
|
18
17
|
expect(response).to have_http_status(:success)
|
19
18
|
json = JSON.parse(response.body)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql_scaffold_fan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fan Zhang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphql
|