activecube-graphql 0.1.19 → 0.1.24

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: b25aea2427a180585cadd733facfca3fd3b97c6b409caf4bbc0c19242811e1ab
4
- data.tar.gz: 83ad80ea19246880867da2b9ff022ef7610ae44e8833b9371afd3a4c94bc601e
3
+ metadata.gz: 86d15d0f813318ca884475efeb1807649823451ebc17d530663346ebe111e802
4
+ data.tar.gz: 37c3a63ae71aa2a1da0db220452eb26cde9c020e131b8f5b873ffd31432902b4
5
5
  SHA512:
6
- metadata.gz: 59e2e1038ec25b78146307ba94b9290c2d505039b3354ad3d7b7d30ee8fc2ba899bb78e1c9a5a3f417be0f9a1bc0bd442cce271680d2469d475c4b63c8b8ad6c
7
- data.tar.gz: 17765551a7dac697c1d2a4a05106621b68da6c331646da30f646d7e5b49e0f7065ddc74fa2efde7b22cd80da2b1257451beea765305813e6e6c18e0ee5c8aaee
6
+ metadata.gz: 61a6651dcaee022002a2d748b4f4ad325d49d1d5cd03891c99948cf6f42394abb867ed8108f933b979e799f8c576e572745794d1c75055c3d9af9d3ccccf5ad0
7
+ data.tar.gz: 1d0e73fa705c9277c8109f96e30a295018cefc5a4c7a636b621e3ed4d68d5e37f32eccbd725d49933f870ac4bcfb9950267657368d44effef5d4419f5c78ae85
@@ -11,40 +11,39 @@
11
11
  </content>
12
12
  <orderEntry type="jdk" jdkName="RVM: ruby-2.6.3" jdkType="RUBY_SDK" />
13
13
  <orderEntry type="sourceFolder" forTests="false" />
14
- <orderEntry type="library" scope="PROVIDED" name="activecube (v0.1.30, RVM: ruby-2.6.3) [gem]" level="application" />
15
- <orderEntry type="library" scope="PROVIDED" name="activemodel (v6.0.3.1, RVM: ruby-2.6.3) [gem]" level="application" />
16
- <orderEntry type="library" scope="PROVIDED" name="activerecord (v6.0.3.1, RVM: ruby-2.6.3) [gem]" level="application" />
17
- <orderEntry type="library" scope="PROVIDED" name="activesupport (v6.0.3.1, RVM: ruby-2.6.3) [gem]" level="application" />
14
+ <orderEntry type="library" scope="PROVIDED" name="activecube (v0.1.35, RVM: ruby-2.6.3) [gem]" level="application" />
15
+ <orderEntry type="library" scope="PROVIDED" name="activemodel (v6.1.4, RVM: ruby-2.6.3) [gem]" level="application" />
16
+ <orderEntry type="library" scope="PROVIDED" name="activerecord (v6.1.4, RVM: ruby-2.6.3) [gem]" level="application" />
17
+ <orderEntry type="library" scope="PROVIDED" name="activesupport (v6.1.4, RVM: ruby-2.6.3) [gem]" level="application" />
18
18
  <orderEntry type="library" scope="PROVIDED" name="bundler (v1.17.3, RVM: ruby-2.6.3) [gem]" level="application" />
19
- <orderEntry type="library" scope="PROVIDED" name="concurrent-ruby (v1.1.7, RVM: ruby-2.6.3) [gem]" level="application" />
19
+ <orderEntry type="library" scope="PROVIDED" name="concurrent-ruby (v1.1.9, RVM: ruby-2.6.3) [gem]" level="application" />
20
20
  <orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.3, RVM: ruby-2.6.3) [gem]" level="application" />
21
- <orderEntry type="library" scope="PROVIDED" name="graphql (v1.11.0, RVM: ruby-2.6.3) [gem]" level="application" />
22
- <orderEntry type="library" scope="PROVIDED" name="i18n (v1.8.5, RVM: ruby-2.6.3) [gem]" level="application" />
23
- <orderEntry type="library" scope="PROVIDED" name="minitest (v5.14.2, RVM: ruby-2.6.3) [gem]" level="application" />
21
+ <orderEntry type="library" scope="PROVIDED" name="graphql (v1.12.19, RVM: ruby-2.6.3) [gem]" level="application" />
22
+ <orderEntry type="library" scope="PROVIDED" name="i18n (v1.8.11, RVM: ruby-2.6.3) [gem]" level="application" />
23
+ <orderEntry type="library" scope="PROVIDED" name="minitest (v5.14.4, RVM: ruby-2.6.3) [gem]" level="application" />
24
24
  <orderEntry type="library" scope="PROVIDED" name="rake (v13.0.1, RVM: ruby-2.6.3) [gem]" level="application" />
25
25
  <orderEntry type="library" scope="PROVIDED" name="rspec (v3.9.0, RVM: ruby-2.6.3) [gem]" level="application" />
26
26
  <orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.9.2, RVM: ruby-2.6.3) [gem]" level="application" />
27
27
  <orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.9.2, RVM: ruby-2.6.3) [gem]" level="application" />
28
28
  <orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.9.1, RVM: ruby-2.6.3) [gem]" level="application" />
29
29
  <orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.9.3, RVM: ruby-2.6.3) [gem]" level="application" />
30
- <orderEntry type="library" scope="PROVIDED" name="thread_safe (v0.3.6, RVM: ruby-2.6.3) [gem]" level="application" />
31
- <orderEntry type="library" scope="PROVIDED" name="tzinfo (v1.2.8, RVM: ruby-2.6.3) [gem]" level="application" />
32
- <orderEntry type="library" scope="PROVIDED" name="zeitwerk (v2.4.2, RVM: ruby-2.6.3) [gem]" level="application" />
30
+ <orderEntry type="library" scope="PROVIDED" name="tzinfo (v2.0.4, RVM: ruby-2.6.3) [gem]" level="application" />
31
+ <orderEntry type="library" scope="PROVIDED" name="zeitwerk (v2.5.1, RVM: ruby-2.6.3) [gem]" level="application" />
33
32
  </component>
34
33
  <component name="RakeTasksCache">
35
34
  <option name="myRootTask">
36
35
  <RakeTaskImpl id="rake">
37
36
  <subtasks>
38
- <RakeTaskImpl description="Build activecube-graphql-0.1.18.gem into the pkg directory" fullCommand="build" id="build" />
37
+ <RakeTaskImpl description="Build activecube-graphql-0.1.19.gem into the pkg directory" fullCommand="build" id="build" />
39
38
  <RakeTaskImpl description="Remove any temporary products" fullCommand="clean" id="clean" />
40
39
  <RakeTaskImpl description="Remove any generated files" fullCommand="clobber" id="clobber" />
41
- <RakeTaskImpl description="Build and install activecube-graphql-0.1.18.gem into system gems" fullCommand="install" id="install" />
40
+ <RakeTaskImpl description="Build and install activecube-graphql-0.1.19.gem into system gems" fullCommand="install" id="install" />
42
41
  <RakeTaskImpl id="install">
43
42
  <subtasks>
44
- <RakeTaskImpl description="Build and install activecube-graphql-0.1.18.gem into system gems without network access" fullCommand="install:local" id="local" />
43
+ <RakeTaskImpl description="Build and install activecube-graphql-0.1.19.gem into system gems without network access" fullCommand="install:local" id="local" />
45
44
  </subtasks>
46
45
  </RakeTaskImpl>
47
- <RakeTaskImpl description="Create tag v0.1.18 and build and push activecube-graphql-0.1.18.gem to rubygems.org" fullCommand="release[remote]" id="release[remote]" />
46
+ <RakeTaskImpl description="Create tag v0.1.19 and build and push activecube-graphql-0.1.19.gem to rubygems.org" fullCommand="release[remote]" id="release[remote]" />
48
47
  <RakeTaskImpl description="Run RSpec code examples" fullCommand="spec" id="spec" />
49
48
  <RakeTaskImpl description="" fullCommand="default" id="default" />
50
49
  <RakeTaskImpl description="" fullCommand="release" id="release" />
data/Gemfile.lock CHANGED
@@ -1,32 +1,32 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- activecube-graphql (0.1.18)
4
+ activecube-graphql (0.1.23)
5
5
  activecube (~> 0.1.28)
6
6
  graphql (~> 1.10)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activecube (0.1.30)
11
+ activecube (0.1.35)
12
12
  activerecord (>= 5.2)
13
- activemodel (6.0.3.1)
14
- activesupport (= 6.0.3.1)
15
- activerecord (6.0.3.1)
16
- activemodel (= 6.0.3.1)
17
- activesupport (= 6.0.3.1)
18
- activesupport (6.0.3.1)
13
+ activemodel (6.1.4)
14
+ activesupport (= 6.1.4)
15
+ activerecord (6.1.4)
16
+ activemodel (= 6.1.4)
17
+ activesupport (= 6.1.4)
18
+ activesupport (6.1.4)
19
19
  concurrent-ruby (~> 1.0, >= 1.0.2)
20
- i18n (>= 0.7, < 2)
21
- minitest (~> 5.1)
22
- tzinfo (~> 1.1)
23
- zeitwerk (~> 2.2, >= 2.2.2)
24
- concurrent-ruby (1.1.7)
20
+ i18n (>= 1.6, < 2)
21
+ minitest (>= 5.1)
22
+ tzinfo (~> 2.0)
23
+ zeitwerk (~> 2.3)
24
+ concurrent-ruby (1.1.9)
25
25
  diff-lcs (1.3)
26
- graphql (1.11.0)
27
- i18n (1.8.5)
26
+ graphql (1.12.19)
27
+ i18n (1.8.11)
28
28
  concurrent-ruby (~> 1.0)
29
- minitest (5.14.2)
29
+ minitest (5.14.4)
30
30
  rake (13.0.1)
31
31
  rspec (3.9.0)
32
32
  rspec-core (~> 3.9.0)
@@ -41,10 +41,9 @@ GEM
41
41
  diff-lcs (>= 1.2.0, < 2.0)
42
42
  rspec-support (~> 3.9.0)
43
43
  rspec-support (3.9.3)
44
- thread_safe (0.3.6)
45
- tzinfo (1.2.8)
46
- thread_safe (~> 0.1)
47
- zeitwerk (2.4.2)
44
+ tzinfo (2.0.4)
45
+ concurrent-ruby (~> 1.0)
46
+ zeitwerk (2.5.1)
48
47
 
49
48
  PLATFORMS
50
49
  ruby
@@ -29,10 +29,13 @@ module Activecube
29
29
  irep_node = ruby_kwargs[:irep_node]
30
30
  tree = ParseTree.new cube, irep_node
31
31
 
32
- database = obj.object.kind_of?(Hash) && obj.object[:database]
32
+ object = obj.object
33
+ database = (object.kind_of?(Hash) && object[:database]) ||
34
+ (object.respond_to?(:database) && object.database)
35
+
33
36
  response = database ? cube.connected_to(database: database) do
34
- execute_query(tree, ctx)
35
- end : execute_query(tree, ctx)
37
+ execute_query(tree, ctx, object)
38
+ end : execute_query(tree, ctx, object)
36
39
 
37
40
  if ctx[:stat_io].respond_to?(:puts) && response.respond_to?(:statistics)
38
41
  ctx[:stat_io].puts(response.statistics)
@@ -46,8 +49,11 @@ module Activecube
46
49
 
47
50
  private
48
51
 
49
- def execute_query tree, ctx
52
+ def execute_query tree, ctx, object
50
53
  cube_query = tree.build_query
54
+ cube_query = object.append_cube_query(cube_query) if object.respond_to?(:append_cube_query)
55
+ cube_query.user_agent = ctx[:sql_user_agent] || 'Ruby/Activecube Graphql'
56
+
51
57
  ctx[:sql_io].puts(cube_query.to_sql) if ctx[:sql_io].respond_to?(:puts)
52
58
  cube_query.query
53
59
  end
@@ -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
- options_keys = context_node.ast_node.arguments.detect{|x| x.name=='options'}.value.arguments.map{|x|
51
- x.name.underscore.to_sym
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]
@@ -1,5 +1,5 @@
1
1
  module Activecube
2
2
  module Graphql
3
- VERSION = "0.1.19"
3
+ VERSION = "0.1.24"
4
4
  end
5
5
  end
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.19
4
+ version: 0.1.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aleksey Studnev
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-12-29 00:00:00.000000000 Z
11
+ date: 2021-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activecube
@@ -114,7 +114,7 @@ homepage: https://github.com/bitquery/activecube-graphql
114
114
  licenses:
115
115
  - MIT
116
116
  metadata: {}
117
- post_install_message:
117
+ post_install_message:
118
118
  rdoc_options: []
119
119
  require_paths:
120
120
  - lib
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  version: '0'
131
131
  requirements: []
132
132
  rubygems_version: 3.0.4
133
- signing_key:
133
+ signing_key:
134
134
  specification_version: 4
135
135
  summary: Multi-Dimensional Queries using GraphQL
136
136
  test_files: []