ibrain-core 0.3.5 → 0.3.6.pre.rc.1
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/app/controllers/ibrain/core/graphql_controller.rb +3 -3
- data/app/graphql/ibrain/resolvers/base_aggregate.rb +1 -1
- data/app/graphql/ibrain/types/aggregate_type.rb +3 -1
- data/app/graphql/ibrain/types/base_api_connection.rb +3 -3
- data/app/graphql/ibrain/types/base_api_object.rb +8 -0
- data/app/graphql/ibrain/types/base_connection.rb +3 -3
- data/app/graphql/ibrain/types/base_object.rb +8 -0
- data/app/models/ibrain/aggregate.rb +11 -0
- data/lib/ibrain/core/version.rb +2 -2
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1e030506b77afbbd1a195a04ce3887a4ca3b2331cba1963985c6d93577f78b3
|
4
|
+
data.tar.gz: 2c4fc926524af27183fc2fec91f6eb3ba301caba1b46ecbdd89c71337d05da0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7014646c14b98c4435e3a75362367eb5f5ee699f065ab92e7afd166d4a87fdcd9d3faae83461aec70e07812416999b0457646f8c72ebc2255733fb1e8942d31f
|
7
|
+
data.tar.gz: e23e0af4d959ee2e1e5e4d424a52cb0288208697c295069d66e37e8091d1e08d3ed338303c5fba847178f1428a6fa4bb3d1f6eae9bb3b31290d0532930d8e83d
|
@@ -36,9 +36,9 @@ module Ibrain
|
|
36
36
|
return [params[:query], prepare_variables(params[:variables]), 'IntrospectionQuery'] if params[:query].try(:include?, 'IntrospectionQuery')
|
37
37
|
|
38
38
|
operations = prepare_variables(params[:operations])
|
39
|
-
query = operations['query']
|
40
|
-
variables = operations['variables']
|
41
|
-
operation_name = operations['operationName']
|
39
|
+
query = operations['query'] || params[:query]
|
40
|
+
variables = operations['variables'] || params[:variables]
|
41
|
+
operation_name = operations['operationName'] || params[:operationName]
|
42
42
|
|
43
43
|
if params[:map].present?
|
44
44
|
JSON.parse(params[:map]).each do |k, arguments|
|
@@ -6,10 +6,10 @@ module Ibrain
|
|
6
6
|
# add `nodes` and `pageInfo` fields, as well as `edge_type(...)` and `node_nullable(...)` overrides
|
7
7
|
include GraphQL::Types::Relay::ConnectionBehaviors
|
8
8
|
|
9
|
-
field :
|
9
|
+
field :aggregate, Ibrain::Types::AggregateType, null: false, camelize: false
|
10
10
|
|
11
|
-
def
|
12
|
-
object.
|
11
|
+
def aggregate
|
12
|
+
Ibrain::Aggregate.new(object.uniq.size)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
@@ -9,6 +9,14 @@ module Ibrain
|
|
9
9
|
connection_type_class(Ibrain::Types::BaseApiConnection)
|
10
10
|
|
11
11
|
field_class Ibrain::Types::BaseApiField
|
12
|
+
|
13
|
+
def self.overridden_graphql_name(name = '')
|
14
|
+
to_s.demodulize.gsub('Type', '').singularize.classify.constantize.table_name
|
15
|
+
rescue StandardError
|
16
|
+
return to_s.demodulize if name.blank?
|
17
|
+
|
18
|
+
name
|
19
|
+
end
|
12
20
|
end
|
13
21
|
end
|
14
22
|
end
|
@@ -6,10 +6,10 @@ module Ibrain
|
|
6
6
|
# add `nodes` and `pageInfo` fields, as well as `edge_type(...)` and `node_nullable(...)` overrides
|
7
7
|
include GraphQL::Types::Relay::ConnectionBehaviors
|
8
8
|
|
9
|
-
field :
|
9
|
+
field :aggregate, Ibrain::Types::AggregateType, null: false, camelize: false
|
10
10
|
|
11
|
-
def
|
12
|
-
object.
|
11
|
+
def aggregate
|
12
|
+
Ibrain::Aggregate.new(object.uniq.size)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
@@ -9,6 +9,14 @@ module Ibrain
|
|
9
9
|
connection_type_class(Ibrain::Types::BaseConnection)
|
10
10
|
|
11
11
|
field_class ::Ibrain::Types::BaseField
|
12
|
+
|
13
|
+
def self.overridden_graphql_name(name = '')
|
14
|
+
to_s.demodulize.gsub('Type', '').singularize.classify.constantize.table_name
|
15
|
+
rescue StandardError
|
16
|
+
return to_s.demodulize if name.blank?
|
17
|
+
|
18
|
+
name
|
19
|
+
end
|
12
20
|
end
|
13
21
|
end
|
14
22
|
end
|
data/lib/ibrain/core/version.rb
CHANGED
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.
|
4
|
+
version: 0.3.6.pre.rc.1
|
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-07-
|
11
|
+
date: 2022-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord-session_store
|
@@ -218,6 +218,7 @@ files:
|
|
218
218
|
- app/models/concerns/ibrain/user_api_authentication.rb
|
219
219
|
- app/models/concerns/ibrain/user_methods.rb
|
220
220
|
- app/models/ibrain/ability.rb
|
221
|
+
- app/models/ibrain/aggregate.rb
|
221
222
|
- app/models/ibrain/application_record.rb
|
222
223
|
- app/models/ibrain/base.rb
|
223
224
|
- app/models/ibrain/legacy_user.rb
|
@@ -301,9 +302,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
301
302
|
version: '0'
|
302
303
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
303
304
|
requirements:
|
304
|
-
- - "
|
305
|
+
- - ">"
|
305
306
|
- !ruby/object:Gem::Version
|
306
|
-
version:
|
307
|
+
version: 1.3.1
|
307
308
|
requirements: []
|
308
309
|
rubygems_version: 3.3.7
|
309
310
|
signing_key:
|