graphql_scaffold_fan 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.DS_Store +0 -0
- data/Gemfile.lock +1 -1
- data/lib/generators/graphql_scaffold/init_generator.rb +0 -1
- data/lib/generators/templates/admin_controller.haml +6 -2
- data/lib/generators/templates/admin_filter.haml +3 -1
- data/lib/generators/templates/admin_schema.haml +5 -2
- data/lib/generators/templates/base_admin_mutation.haml +3 -1
- data/lib/generators/templates/base_object.haml +2 -1
- data/lib/generators/templates/list_metadata_type.haml +2 -0
- data/lib/generators/templates/mutation_create.haml +6 -4
- data/lib/generators/templates/mutation_create_test.haml +3 -1
- data/lib/generators/templates/mutation_delete.haml +3 -1
- data/lib/generators/templates/mutation_delete_test.haml +3 -1
- data/lib/generators/templates/mutation_test.haml +3 -4
- data/lib/generators/templates/mutation_type.haml +2 -1
- data/lib/generators/templates/mutation_update.haml +3 -0
- data/lib/generators/templates/mutation_update_test.haml +3 -1
- data/lib/generators/templates/query_test.haml +3 -2
- data/lib/generators/templates/query_type.haml +2 -1
- data/lib/graphql_scaffold_fan/version.rb +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: f4b62f10ce88ff8a2f158ca1bc5a14c662310f3a42043c04b98fe2642307b74b
|
4
|
+
data.tar.gz: 74678f4d3d904df21d921cfd337de12a672c41aa10479ddb7ebd1f22a28e1449
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc9df1b39863ff2abd172c3b73c762c4fc445267a264494778cf69bb2104480fdbba94849cc9845fd6acbf6113a7f154b399f46444706c0b394224963b7a90e3
|
7
|
+
data.tar.gz: f4b3f2ea7641ad63e1a05923ad7060e21fcbf1013f85f12fa3dec3eb27a63544a47f2c8f233b5dc967b1f3bfab157cbb4d52a3b18ccd936584264ec85be64bc7
|
data/.DS_Store
CHANGED
Binary file
|
data/Gemfile.lock
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Comment
|
1
4
|
class AdminGraphqlController < ApplicationController
|
2
5
|
include GraphqlDevise::Concerns::SetUserByToken
|
3
6
|
|
@@ -51,6 +54,7 @@ class AdminGraphqlController < ApplicationController
|
|
51
54
|
logger.error err.message
|
52
55
|
logger.error err.backtrace.join("\n")
|
53
56
|
|
54
|
-
render json: { errors: [{ message: err.message, backtrace: err.backtrace }], data: {} },
|
57
|
+
render json: { errors: [{ message: err.message, backtrace: err.backtrace }], data: {} },
|
58
|
+
status: :internal_server_error
|
55
59
|
end
|
56
|
-
end
|
60
|
+
end
|
@@ -1,8 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Comment
|
1
4
|
class <%= class_name %>AdminSchema < GraphQL::Schema
|
2
5
|
use GraphQL::Tracing::NewRelicTracing, set_transaction_name: true
|
3
6
|
use GraphqlDevise::SchemaPlugin.new(
|
4
|
-
query:
|
5
|
-
mutation:
|
7
|
+
query: Types::Query::AdminUserQueryType,
|
8
|
+
mutation: Types::Mutation::AdminUserMutationType,
|
6
9
|
resource_loaders: [
|
7
10
|
GraphqlDevise::ResourceLoader.new(AdminUser, only: %i[login logout])
|
8
11
|
]
|
@@ -1,15 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Comment
|
1
4
|
module Mutations
|
2
5
|
module Admin
|
3
6
|
class <%= class_name %>s::Create<%= class_name %> < BaseAdminMutation
|
4
|
-
|
5
7
|
type Types::Admin::<%= class_name %>Type
|
6
8
|
|
7
9
|
def resolve(**args)
|
8
|
-
|
10
|
+
<%= class_name.underscore %> = <%= class_name %>.new(args)
|
9
11
|
if <%= class_name.underscore %>.save
|
10
|
-
|
12
|
+
<%= class_name.underscore %>
|
11
13
|
else
|
12
|
-
context.add_error(GraphQL::ExecutionError.new(
|
14
|
+
context.add_error(GraphQL::ExecutionError.new(<%= class_name.underscore %>.errors.full_messages.join(', ')))
|
13
15
|
end
|
14
16
|
end
|
15
17
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rails_helper'
|
2
4
|
|
3
5
|
RSpec.describe Mutations::Admin::<%= class_name %>s::Create<%= class_name %>, type: :request do
|
@@ -29,4 +31,4 @@ RSpec.describe Mutations::Admin::<%= class_name %>s::Create<%= class_name %>, ty
|
|
29
31
|
}
|
30
32
|
GQL
|
31
33
|
end
|
32
|
-
end
|
34
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rails_helper'
|
2
4
|
|
3
5
|
RSpec.describe Mutations::Admin::<%= class_name %>s::Delete<%= class_name %>, type: :request do
|
@@ -34,4 +36,4 @@ RSpec.describe Mutations::Admin::<%= class_name %>s::Delete<%= class_name %>, ty
|
|
34
36
|
}
|
35
37
|
GQL
|
36
38
|
end
|
37
|
-
end
|
39
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'rails_helper'
|
3
4
|
RSpec.describe Mutations::<%= class_name %>, type: :request do
|
4
|
-
|
5
5
|
describe 'resolve' do
|
6
6
|
|
7
7
|
end
|
@@ -9,8 +9,7 @@ RSpec.describe Mutations::<%= class_name %>, type: :request do
|
|
9
9
|
def query(**args)
|
10
10
|
<<~GQL
|
11
11
|
mutation <%= class_name.underscore %>{
|
12
|
-
<%= class_name.underscore %>{
|
13
|
-
|
12
|
+
<%= class_name.underscore %>{
|
14
13
|
}
|
15
14
|
}
|
16
15
|
GQL
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rails_helper'
|
2
4
|
|
3
5
|
RSpec.describe Mutations::Admin::<%= class_name %>s::Update<%= class_name %>, type: :request do
|
@@ -32,4 +34,4 @@ RSpec.describe Mutations::Admin::<%= class_name %>s::Update<%= class_name %>, ty
|
|
32
34
|
}
|
33
35
|
GQL
|
34
36
|
end
|
35
|
-
end
|
37
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rails_helper'
|
2
4
|
|
3
5
|
RSpec.describe Resolvers::<%= class_name %>, type: :request do
|
@@ -11,7 +13,6 @@ RSpec.describe Resolvers::<%= class_name %>, type: :request do
|
|
11
13
|
|
12
14
|
describe '#resolve' do
|
13
15
|
it 'pass' do
|
14
|
-
|
15
16
|
end
|
16
17
|
end
|
17
|
-
end
|
18
|
+
end
|