ibrain-core 0.3.9 → 0.4.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54aa7f0b5250da9ca3b9855824c529007a2c01cbc12eaf63347298261c1422e7
4
- data.tar.gz: 0c1f05cba8a7817f84b8c4cb85953ff5feea2f2a5753cda6a486498426133bb7
3
+ metadata.gz: 33b4e300564f07cbe14ca37a664a7ae4c98ed7606d889ec24a6552d11ce63a10
4
+ data.tar.gz: 26ebbe777b2c7a7df42e16c67740e5a3208deedd733c1116efe71ddacb007a0c
5
5
  SHA512:
6
- metadata.gz: 9ced3c27494f81a998bb7c6960141c58ce8902b44199668e63986771db01a5f033b4d59cf7a5518fc9f3442111582a8b7791e6f2e6700a0204b175132effb23a
7
- data.tar.gz: d4f72b228c824b4fb68afa420a2caba8180e362ad35dcb154d81faf61fb420569407d7a4abc8f3637ae90b9ba10de3606e4687d6ee809d5281c9de34d45d0f8f
6
+ metadata.gz: 2b711b99238fb17d417cedf9c5b861e5dc4a26f73704868101b81f5c41c05d77940abb9d5ad151b10ec5998ddcae17f379a8d78287c9c6d7590fa72557776229
7
+ data.tar.gz: c970a21f21a510604e255782d9ae5142b9d7ba226561930201190ef7f47d93663ce21d03b871acaf087c7dabf94fb74f9e3edb271549b16e29f9189e732a22d1
@@ -96,7 +96,7 @@ module Ibrain
96
96
  end
97
97
 
98
98
  def max_depth(operation_name)
99
- operation_name == 'IntrospectionQuery' ? 100 : Ibrain::Config.graphql_max_depth
99
+ operation_name == 'IntrospectionQuery' ? nil : Ibrain::Config.graphql_max_depth
100
100
  end
101
101
  end
102
102
  end
@@ -11,6 +11,16 @@ module Ibrain
11
11
  field_class ::Ibrain::Types::BaseField
12
12
 
13
13
  field :name, String, null: true
14
+
15
+ protected
16
+
17
+ def loader
18
+ Ibrain::Loaders::AssociationLoader
19
+ end
20
+
21
+ def current_user
22
+ context.try(:fetch, :current_user)
23
+ end
14
24
  end
15
25
  end
16
26
  end
@@ -42,6 +42,7 @@ module Ibrain
42
42
  end
43
43
 
44
44
  template "mutation.erb", "#{options[:directory]}/mutations/#{file_name}.rb"
45
+ return unless ::Ibrain::Config.is_auto_append_mutation
45
46
 
46
47
  in_root do
47
48
  gsub_file "#{options[:directory]}/types/mutation_type.rb", / \# TODO: Add Mutations as fields\s*\n/m, ""
@@ -25,6 +25,7 @@ module Ibrain
25
25
  end
26
26
 
27
27
  template "resolver.erb", "#{options[:directory]}/resolvers/#{file_name}.rb"
28
+ return unless ::Ibrain::Config.is_auto_append_mutation
28
29
 
29
30
  in_root do
30
31
  gsub_file "#{options[:directory]}/types/query_type.rb", / \# TODO: Add Resolvers as fields\s*\n/m, ""
@@ -43,6 +43,7 @@ module Ibrain
43
43
 
44
44
  template "resolvers.erb", "#{options[:directory]}/resolvers/#{file_name}.rb"
45
45
  template "aggregate.erb", "#{options[:directory]}/resolvers/#{file_name}_aggregate.rb"
46
+ return unless ::Ibrain::Config.is_auto_append_mutation
46
47
 
47
48
  in_root do
48
49
  gsub_file "#{options[:directory]}/types/query_type.rb", / \# TODO: Add Resolvers as fields\s*\n/m, ""
@@ -3,7 +3,7 @@
3
3
  <% module_namespacing_when_supported do -%>
4
4
  module Types
5
5
  module Objects
6
- class <%= type_ruby_name.split('::')[-1] %> < Ibrain::Types::BaseObject
6
+ class <%= type_ruby_name.split('::')[-1] %> < Ibrain::Types::BaseType
7
7
  implements Ibrain::Interfaces::RecordInterface
8
8
 
9
9
  description '<%= type_ruby_name.split('::')[-1] %>'
@@ -50,6 +50,9 @@ Ibrain.config do |config|
50
50
 
51
51
  # For max depth graphql
52
52
  config.graphql_max_depth = 3
53
+
54
+ # For auto append mutation to graphql
55
+ config.is_auto_append_mutation = true
53
56
  end
54
57
 
55
58
  <% if defined?(Ibrain::Api::Engine) -%>
@@ -55,6 +55,8 @@ module Ibrain
55
55
 
56
56
  preference :graphql_max_depth, :integer, default: 3
57
57
 
58
+ preference :is_auto_append_mutation, :boolean, default: true
59
+
58
60
  def static_model_preferences
59
61
  @static_model_preferences ||= Ibrain::Preferences::StaticModelPreferences.new
60
62
  end
@@ -1,14 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ibrain
4
- VERSION = "0.3.9"
4
+ VERSION = "0.4.2"
5
5
 
6
6
  def self.ibrain_version
7
7
  VERSION
8
8
  end
9
9
 
10
10
  def self.previous_ibrain_minor_version
11
- '0.3.8'
11
+ '0.4.1'
12
12
  end
13
13
 
14
14
  def self.ibrain_gem_version
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ibrain-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.9
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tai Nguyen Van
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-01 00:00:00.000000000 Z
11
+ date: 2022-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord-session_store
@@ -308,7 +308,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
308
308
  - !ruby/object:Gem::Version
309
309
  version: '0'
310
310
  requirements: []
311
- rubygems_version: 3.3.7
311
+ rubygems_version: 3.3.20
312
312
  signing_key:
313
313
  specification_version: 4
314
314
  summary: Its Core is an sso authen gem for Ruby on Rails.