activecube-graphql 0.1.22 → 0.1.24
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/Gemfile.lock +1 -1
- data/lib/activecube/graphql/cube_field.rb +4 -3
- data/lib/activecube/graphql/parse_tree.rb +10 -3
- data/lib/activecube/graphql/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: 86d15d0f813318ca884475efeb1807649823451ebc17d530663346ebe111e802
|
|
4
|
+
data.tar.gz: 37c3a63ae71aa2a1da0db220452eb26cde9c020e131b8f5b873ffd31432902b4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 61a6651dcaee022002a2d748b4f4ad325d49d1d5cd03891c99948cf6f42394abb867ed8108f933b979e799f8c576e572745794d1c75055c3d9af9d3ccccf5ad0
|
|
7
|
+
data.tar.gz: 1d0e73fa705c9277c8109f96e30a295018cefc5a4c7a636b621e3ed4d68d5e37f32eccbd725d49933f870ac4bcfb9950267657368d44effef5d4419f5c78ae85
|
data/Gemfile.lock
CHANGED
|
@@ -34,8 +34,8 @@ module Activecube
|
|
|
34
34
|
(object.respond_to?(:database) && object.database)
|
|
35
35
|
|
|
36
36
|
response = database ? cube.connected_to(database: database) do
|
|
37
|
-
execute_query(tree, ctx)
|
|
38
|
-
end : execute_query(tree, ctx)
|
|
37
|
+
execute_query(tree, ctx, object)
|
|
38
|
+
end : execute_query(tree, ctx, object)
|
|
39
39
|
|
|
40
40
|
if ctx[:stat_io].respond_to?(:puts) && response.respond_to?(:statistics)
|
|
41
41
|
ctx[:stat_io].puts(response.statistics)
|
|
@@ -49,8 +49,9 @@ module Activecube
|
|
|
49
49
|
|
|
50
50
|
private
|
|
51
51
|
|
|
52
|
-
def execute_query tree, ctx
|
|
52
|
+
def execute_query tree, ctx, object
|
|
53
53
|
cube_query = tree.build_query
|
|
54
|
+
cube_query = object.append_cube_query(cube_query) if object.respond_to?(:append_cube_query)
|
|
54
55
|
cube_query.user_agent = ctx[:sql_user_agent] || 'Ruby/Activecube Graphql'
|
|
55
56
|
|
|
56
57
|
ctx[:sql_io].puts(cube_query.to_sql) if ctx[:sql_io].respond_to?(:puts)
|
|
@@ -47,9 +47,16 @@ module Activecube
|
|
|
47
47
|
|
|
48
48
|
def sort_node_arguments ast_node, arguments
|
|
49
49
|
if (options = arguments['options']).kind_of?(Hash)
|
|
50
|
-
|
|
51
|
-
x
|
|
52
|
-
|
|
50
|
+
if opt_keys_args = context_node.ast_node.arguments.detect{|x| x.name=='options'}.value.try(:arguments)
|
|
51
|
+
options_keys = opt_keys_args.map{|x|
|
|
52
|
+
x.name.underscore.to_sym
|
|
53
|
+
}
|
|
54
|
+
elsif opt_keys_args_opt_name = context_node.ast_node.arguments.detect{|x| x.name=='options'}.value.try(:name)
|
|
55
|
+
options_keys = context_node.query.variables[opt_keys_args_opt_name].arguments.argument_values.map{|x, y|
|
|
56
|
+
x.underscore.to_sym
|
|
57
|
+
}
|
|
58
|
+
end
|
|
59
|
+
|
|
53
60
|
arguments['options'] = Hash[
|
|
54
61
|
options_keys.collect{|key|
|
|
55
62
|
raise "Unmatched key #{key}" unless options[key]
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activecube-graphql
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.24
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Aleksey Studnev
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-
|
|
11
|
+
date: 2021-12-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activecube
|