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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c5d1ca8a0189f63ad24ce0019951498fd7ca52cece5e315ab891ae45a4644a9c
4
- data.tar.gz: f5c422b16830b29a6c53c78a826f884fd4f94f5cbc621431394b63b4d9bf07fd
3
+ metadata.gz: f4b62f10ce88ff8a2f158ca1bc5a14c662310f3a42043c04b98fe2642307b74b
4
+ data.tar.gz: 74678f4d3d904df21d921cfd337de12a672c41aa10479ddb7ebd1f22a28e1449
5
5
  SHA512:
6
- metadata.gz: 1cd7db1267f68770cea00fdaa8c50f92dbae8238f5acca3f12abd190766dafb63f4c342d684324586d2616a8ef500d57bc8943ddf635c8156578c8907a914cb4
7
- data.tar.gz: 2b1e7e7eab3ef3c1cc39e3e8c47b0210bb537c9c0d46f71ceef3c337e3d69526c0303e4dd809d44fe984308ddc6ad38a3a360c36ed76f41a09e61bdc9d33bf74
6
+ metadata.gz: dc9df1b39863ff2abd172c3b73c762c4fc445267a264494778cf69bb2104480fdbba94849cc9845fd6acbf6113a7f154b399f46444706c0b394224963b7a90e3
7
+ data.tar.gz: f4b3f2ea7641ad63e1a05923ad7060e21fcbf1013f85f12fa3dec3eb27a63544a47f2c8f233b5dc967b1f3bfab157cbb4d52a3b18ccd936584264ec85be64bc7
data/.DS_Store CHANGED
Binary file
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- graphql_scaffold_fan (0.2.2)
4
+ graphql_scaffold_fan (0.2.3)
5
5
  graphql
6
6
  graphql_playground-rails
7
7
 
@@ -59,7 +59,6 @@ module GraphqlScaffold
59
59
  end
60
60
 
61
61
  def add_gem_dependencies
62
-
63
62
  route_file_path = 'Gemfile'
64
63
 
65
64
  p 'Gemfile does not exist' unless File.exist?(route_file_path)
@@ -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: {} }, status: :internal_server_error
57
+ render json: { errors: [{ message: err.message, backtrace: err.backtrace }], data: {} },
58
+ status: :internal_server_error
55
59
  end
56
- end
60
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Types
2
4
  module Inputs
3
5
  module Admin
@@ -14,4 +16,4 @@ module Types
14
16
  end
15
17
  end
16
18
  end
17
- end
19
+ 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: Types::Query::AdminUserQueryType,
5
- mutation: Types::Mutation::AdminUserMutationType,
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,4 +1,6 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Mutations
2
4
  class BaseAdminMutation < GraphQL::Schema::Mutation
3
5
  end
4
- end
6
+ end
@@ -1,6 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Types
2
4
  class BaseObject < GraphQL::Schema::Object
3
-
4
5
  def self.has_admin_fields(attach_sttr, **conf)
5
6
  attach_sttr = attach_sttr.to_s
6
7
  get_one = attach_sttr
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Types
2
4
  module Admin
3
5
  class ListMetadataType < Types::BaseObject
@@ -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
- <%= class_name.underscore %> = <%= class_name %>.new(args)
10
+ <%= class_name.underscore %> = <%= class_name %>.new(args)
9
11
  if <%= class_name.underscore %>.save
10
- <%= class_name.underscore %>
12
+ <%= class_name.underscore %>
11
13
  else
12
- context.add_error(GraphQL::ExecutionError.new( <%= class_name.underscore %>.errors.full_messages.join(', ')))
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,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Comment
1
4
  module Mutations
2
5
  module Admin
3
6
  class <%= class_name %>s::Delete<%= class_name %> < BaseAdminMutation
4
-
5
7
  type Types::Admin::<%= class_name %>Type
6
8
 
7
9
  def resolve(id:)
@@ -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
- require 'rails_helper'
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,7 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Types
2
4
  module Admin
3
5
  class MutationType < Types::BaseObject
4
-
5
6
  has_admin_mutation :<%= class_name %>
6
7
  end
7
8
  end
@@ -1,3 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Comment
1
4
  module Mutations
2
5
  module Admin
3
6
  class <%= class_name %>s::Update<%= class_name %> < BaseAdminMutation
@@ -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
@@ -1,7 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Types
2
4
  module Admin
3
5
  class QueryType < Types::BaseObject
4
-
5
6
  has_admin_fields :<%= class_name %>
6
7
  end
7
8
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GraphqlScaffoldFan
4
- VERSION = '0.2.2'
4
+ VERSION = '0.2.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql_scaffold_fan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fan Zhang