activecube-graphql 0.1.20 → 0.1.25

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: f40dfd438429b751590b990dd74293efaeddf44196408376568622b031996077
4
- data.tar.gz: d457c6825398059230abacccf5c65d166929fb8feb69a3ef93abb1ff4bf99de3
3
+ metadata.gz: f2e6172c07df1e643e9bc1f37d505e3ccc31e58cfd1741ee37850eba6ffc6dfb
4
+ data.tar.gz: b6aab3e06f0d78cfc455b1e834f93b0f79d411e93127da6983444297b8ebb3b0
5
5
  SHA512:
6
- metadata.gz: cd77b677c65d9ae5be1bd4b918aeb235ff0c077a0ab04e57efbbac9dac4df1fe579bdcb382dd1c6205ff0efc2bbc9c213e93bb3f3eb2377a287a8967b4a23496
7
- data.tar.gz: 2de88d604b46cea71e7a8fe8e714ac84b060089484bdf2b7c8dbe9192eabff1cce191726d5268cde9e7673378bfd91ed0b18b2d190c6f23984bce029708e53a3
6
+ metadata.gz: 633d43b3712caafd333bd12aafb953ad9f02c9aa0b904bac7a7d6f4271dbe36c01af9a5a638dcc0174ed8f610af4dda70c2f6f9950283f97fe5b2fa7b86709ff
7
+ data.tar.gz: c88d7d9910fb014e558019e34f964143e0631bcf9cb07b3dae7f0df3f898db994d1cd55cb7308f5395f55b85ee7887b7e5942f628e5d5fe59a53411c92217706
data/Gemfile.lock CHANGED
@@ -1,32 +1,32 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- activecube-graphql (0.1.19)
4
+ activecube-graphql (0.1.22)
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.12.4)
27
- i18n (1.8.6)
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.9)
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,14 +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]
33
- response = database ? cube.connected_to(database: database) do
34
- execute_query(tree, ctx)
35
- end : execute_query(tree, ctx)
32
+ object = obj.object
33
+ database = (object.kind_of?(Hash) && object[:database]) ||
34
+ (object.respond_to?(:database) && object.database)
36
35
 
37
- if ctx[:stat_io].respond_to?(:puts) && response.respond_to?(:statistics)
38
- ctx[:stat_io].puts(response.statistics)
39
- end
36
+ response = database ? cube.connected_to(database: database) do
37
+ execute_query(tree, ctx, object)
38
+ end : execute_query(tree, ctx, object)
40
39
 
41
40
  ResponseBuilder.new tree, response
42
41
 
@@ -46,10 +45,15 @@ module Activecube
46
45
 
47
46
  private
48
47
 
49
- def execute_query tree, ctx
48
+ def execute_query tree, ctx, object
50
49
  cube_query = tree.build_query
51
- ctx[:sql_io].puts(cube_query.to_sql) if ctx[:sql_io].respond_to?(:puts)
52
- cube_query.user_agent = ctx[:sql_user_agent] || 'Ruby/Activecube Graphql'
50
+ cube_query = object.append_cube_query(cube_query) if object.respond_to?(:append_cube_query)
51
+
52
+ stats = ctx[:stats]
53
+ cube_query.stats = stats
54
+
55
+ sql_io = stats.sql_io
56
+ sql_io.puts(cube_query.to_sql) if sql_io.respond_to?(:puts)
53
57
  cube_query.query
54
58
  end
55
59
 
@@ -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.20"
3
+ VERSION = "0.1.25"
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.20
4
+ version: 0.1.25
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: 2021-11-17 00:00:00.000000000 Z
11
+ date: 2022-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activecube
@@ -90,10 +90,6 @@ extensions: []
90
90
  extra_rdoc_files: []
91
91
  files:
92
92
  - ".gitignore"
93
- - ".idea/activecube-graphql.iml"
94
- - ".idea/misc.xml"
95
- - ".idea/modules.xml"
96
- - ".idea/workspace.xml"
97
93
  - ".rspec"
98
94
  - ".travis.yml"
99
95
  - CODE_OF_CONDUCT.md
@@ -114,7 +110,7 @@ homepage: https://github.com/bitquery/activecube-graphql
114
110
  licenses:
115
111
  - MIT
116
112
  metadata: {}
117
- post_install_message:
113
+ post_install_message:
118
114
  rdoc_options: []
119
115
  require_paths:
120
116
  - lib
@@ -129,8 +125,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
129
125
  - !ruby/object:Gem::Version
130
126
  version: '0'
131
127
  requirements: []
132
- rubygems_version: 3.0.4
133
- signing_key:
128
+ rubygems_version: 3.0.3
129
+ signing_key:
134
130
  specification_version: 4
135
131
  summary: Multi-Dimensional Queries using GraphQL
136
132
  test_files: []
@@ -1,62 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="RUBY_MODULE" version="4">
3
- <component name="ModuleRunConfigurationManager">
4
- <shared />
5
- </component>
6
- <component name="NewModuleRootManager">
7
- <content url="file://$MODULE_DIR$">
8
- <sourceFolder url="file://$MODULE_DIR$/features" isTestSource="true" />
9
- <sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
10
- <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
11
- </content>
12
- <orderEntry type="jdk" jdkName="RVM: ruby-2.6.3" jdkType="RUBY_SDK" />
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" />
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" />
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.12.4, RVM: ruby-2.6.3) [gem]" level="application" />
22
- <orderEntry type="library" scope="PROVIDED" name="i18n (v1.8.6, 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" />
24
- <orderEntry type="library" scope="PROVIDED" name="rake (v13.0.1, RVM: ruby-2.6.3) [gem]" level="application" />
25
- <orderEntry type="library" scope="PROVIDED" name="rspec (v3.9.0, RVM: ruby-2.6.3) [gem]" level="application" />
26
- <orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.9.2, RVM: ruby-2.6.3) [gem]" level="application" />
27
- <orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.9.2, RVM: ruby-2.6.3) [gem]" level="application" />
28
- <orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.9.1, RVM: ruby-2.6.3) [gem]" level="application" />
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.9, 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" />
33
- </component>
34
- <component name="RakeTasksCache">
35
- <option name="myRootTask">
36
- <RakeTaskImpl id="rake">
37
- <subtasks>
38
- <RakeTaskImpl description="Build activecube-graphql-0.1.19.gem into the pkg directory" fullCommand="build" id="build" />
39
- <RakeTaskImpl description="Remove any temporary products" fullCommand="clean" id="clean" />
40
- <RakeTaskImpl description="Remove any generated files" fullCommand="clobber" id="clobber" />
41
- <RakeTaskImpl description="Build and install activecube-graphql-0.1.19.gem into system gems" fullCommand="install" id="install" />
42
- <RakeTaskImpl id="install">
43
- <subtasks>
44
- <RakeTaskImpl description="Build and install activecube-graphql-0.1.19.gem into system gems without network access" fullCommand="install:local" id="local" />
45
- </subtasks>
46
- </RakeTaskImpl>
47
- <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
- <RakeTaskImpl description="Run RSpec code examples" fullCommand="spec" id="spec" />
49
- <RakeTaskImpl description="" fullCommand="default" id="default" />
50
- <RakeTaskImpl description="" fullCommand="release" id="release" />
51
- <RakeTaskImpl id="release">
52
- <subtasks>
53
- <RakeTaskImpl description="" fullCommand="release:guard_clean" id="guard_clean" />
54
- <RakeTaskImpl description="" fullCommand="release:rubygem_push" id="rubygem_push" />
55
- <RakeTaskImpl description="" fullCommand="release:source_control_push" id="source_control_push" />
56
- </subtasks>
57
- </RakeTaskImpl>
58
- </subtasks>
59
- </RakeTaskImpl>
60
- </option>
61
- </component>
62
- </module>
data/.idea/misc.xml DELETED
@@ -1,7 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="JavaScriptSettings">
4
- <option name="languageLevel" value="ES6" />
5
- </component>
6
- <component name="ProjectRootManager" version="2" project-jdk-name="ruby-2.3.3-p222" project-jdk-type="RUBY_SDK" />
7
- </project>
data/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/activecube-graphql.iml" filepath="$PROJECT_DIR$/.idea/activecube-graphql.iml" />
6
- </modules>
7
- </component>
8
- </project>
data/.idea/workspace.xml DELETED
@@ -1,26 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectId" id="1YAAllwtnwKyBVlMjptPbbPRXH8" />
4
- <component name="ProjectViewState">
5
- <option name="hideEmptyMiddlePackages" value="true" />
6
- <option name="showLibraryContents" value="true" />
7
- <option name="showMembers" value="true" />
8
- </component>
9
- <component name="PropertiesComponent">
10
- <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
11
- <property name="nodejs_npm_path_reset_for_default_project" value="true" />
12
- <property name="settings.editor.selected.configurable" value="preferences.lookFeel" />
13
- </component>
14
- <component name="RunDashboard">
15
- <option name="ruleStates">
16
- <list>
17
- <RuleState>
18
- <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
19
- </RuleState>
20
- <RuleState>
21
- <option name="name" value="StatusDashboardGroupingRule" />
22
- </RuleState>
23
- </list>
24
- </option>
25
- </component>
26
- </project>