activecube-graphql 0.1.18 → 0.1.22
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/.idea/activecube-graphql.iml +38 -11
- data/Gemfile.lock +19 -20
- data/lib/activecube/graphql/cube_field.rb +6 -1
- data/lib/activecube/graphql/parse_tree.rb +6 -1
- data/lib/activecube/graphql/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9ff3d9f5f10865d312810addf9b8b2b02d5e1da42bfb450c6b6a2d1c6c245720
|
|
4
|
+
data.tar.gz: 958384371784f96feeddce3d9e3219bd6355138939d11c7e6be49810e5eea98a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 50a5432f0a2d372b4ee9ae646675c79c6e2e42dddc0b68dc06147308fa995f18bde07b3d8d29f094f734acb73010945d86c822d346248e8f9fbf20fb923eff03
|
|
7
|
+
data.tar.gz: 7a51f2c654add24b517266bd6de37d7e96fce3f4b298fd026959f23c163e972c00733fe2c5a7054757ec8c1fc3604026836654249e401024c2a1fac1170d2805
|
|
@@ -11,24 +11,51 @@
|
|
|
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.
|
|
15
|
-
<orderEntry type="library" scope="PROVIDED" name="activemodel (v6.
|
|
16
|
-
<orderEntry type="library" scope="PROVIDED" name="activerecord (v6.
|
|
17
|
-
<orderEntry type="library" scope="PROVIDED" name="activesupport (v6.
|
|
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.
|
|
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.
|
|
22
|
-
<orderEntry type="library" scope="PROVIDED" name="i18n (v1.8.
|
|
23
|
-
<orderEntry type="library" scope="PROVIDED" name="minitest (v5.14.
|
|
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="
|
|
31
|
-
<orderEntry type="library" scope="PROVIDED" name="
|
|
32
|
-
|
|
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" />
|
|
32
|
+
</component>
|
|
33
|
+
<component name="RakeTasksCache">
|
|
34
|
+
<option name="myRootTask">
|
|
35
|
+
<RakeTaskImpl id="rake">
|
|
36
|
+
<subtasks>
|
|
37
|
+
<RakeTaskImpl description="Build activecube-graphql-0.1.19.gem into the pkg directory" fullCommand="build" id="build" />
|
|
38
|
+
<RakeTaskImpl description="Remove any temporary products" fullCommand="clean" id="clean" />
|
|
39
|
+
<RakeTaskImpl description="Remove any generated files" fullCommand="clobber" id="clobber" />
|
|
40
|
+
<RakeTaskImpl description="Build and install activecube-graphql-0.1.19.gem into system gems" fullCommand="install" id="install" />
|
|
41
|
+
<RakeTaskImpl id="install">
|
|
42
|
+
<subtasks>
|
|
43
|
+
<RakeTaskImpl description="Build and install activecube-graphql-0.1.19.gem into system gems without network access" fullCommand="install:local" id="local" />
|
|
44
|
+
</subtasks>
|
|
45
|
+
</RakeTaskImpl>
|
|
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]" />
|
|
47
|
+
<RakeTaskImpl description="Run RSpec code examples" fullCommand="spec" id="spec" />
|
|
48
|
+
<RakeTaskImpl description="" fullCommand="default" id="default" />
|
|
49
|
+
<RakeTaskImpl description="" fullCommand="release" id="release" />
|
|
50
|
+
<RakeTaskImpl id="release">
|
|
51
|
+
<subtasks>
|
|
52
|
+
<RakeTaskImpl description="" fullCommand="release:guard_clean" id="guard_clean" />
|
|
53
|
+
<RakeTaskImpl description="" fullCommand="release:rubygem_push" id="rubygem_push" />
|
|
54
|
+
<RakeTaskImpl description="" fullCommand="release:source_control_push" id="source_control_push" />
|
|
55
|
+
</subtasks>
|
|
56
|
+
</RakeTaskImpl>
|
|
57
|
+
</subtasks>
|
|
58
|
+
</RakeTaskImpl>
|
|
59
|
+
</option>
|
|
33
60
|
</component>
|
|
34
61
|
</module>
|
data/Gemfile.lock
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
activecube-graphql (0.1.
|
|
4
|
+
activecube-graphql (0.1.21)
|
|
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.
|
|
11
|
+
activecube (0.1.35)
|
|
12
12
|
activerecord (>= 5.2)
|
|
13
|
-
activemodel (6.
|
|
14
|
-
activesupport (= 6.
|
|
15
|
-
activerecord (6.
|
|
16
|
-
activemodel (= 6.
|
|
17
|
-
activesupport (= 6.
|
|
18
|
-
activesupport (6.
|
|
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 (>=
|
|
21
|
-
minitest (
|
|
22
|
-
tzinfo (~>
|
|
23
|
-
zeitwerk (~> 2.
|
|
24
|
-
concurrent-ruby (1.1.
|
|
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.
|
|
27
|
-
i18n (1.8.
|
|
26
|
+
graphql (1.12.19)
|
|
27
|
+
i18n (1.8.11)
|
|
28
28
|
concurrent-ruby (~> 1.0)
|
|
29
|
-
minitest (5.14.
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
zeitwerk (2.4.1)
|
|
44
|
+
tzinfo (2.0.4)
|
|
45
|
+
concurrent-ruby (~> 1.0)
|
|
46
|
+
zeitwerk (2.5.1)
|
|
48
47
|
|
|
49
48
|
PLATFORMS
|
|
50
49
|
ruby
|
|
@@ -29,7 +29,10 @@ module Activecube
|
|
|
29
29
|
irep_node = ruby_kwargs[:irep_node]
|
|
30
30
|
tree = ParseTree.new cube, irep_node
|
|
31
31
|
|
|
32
|
-
|
|
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
37
|
execute_query(tree, ctx)
|
|
35
38
|
end : execute_query(tree, ctx)
|
|
@@ -48,6 +51,8 @@ module Activecube
|
|
|
48
51
|
|
|
49
52
|
def execute_query tree, ctx
|
|
50
53
|
cube_query = tree.build_query
|
|
54
|
+
cube_query.user_agent = ctx[:sql_user_agent] || 'Ruby/Activecube Graphql'
|
|
55
|
+
|
|
51
56
|
ctx[:sql_io].puts(cube_query.to_sql) if ctx[:sql_io].respond_to?(:puts)
|
|
52
57
|
cube_query.query
|
|
53
58
|
end
|
|
@@ -6,6 +6,7 @@ module Activecube
|
|
|
6
6
|
|
|
7
7
|
TYPENAME = '__typename'
|
|
8
8
|
KEY_FIELD_PREFIX = '_aq.'
|
|
9
|
+
NULLABLE_OPERATORS = [:eq,:not_eq,:is,:not]
|
|
9
10
|
|
|
10
11
|
attr_reader :arguments, :ast_node, :cube, :parent, :name, :definition, :key,
|
|
11
12
|
:children, :metric, :dimension, :field, :context_node
|
|
@@ -131,11 +132,15 @@ module Activecube
|
|
|
131
132
|
hash.each_pair do |operator, arg|
|
|
132
133
|
selector = cube.selectors[k]
|
|
133
134
|
raise Activecube::InputArgumentError, "#{selector} does not handle method '#{operator}' for #{element} '#{k}'" unless selector.respond_to?(operator)
|
|
134
|
-
element = element.when( selector.send(operator, arg) )
|
|
135
|
+
element = element.when( selector.send(operator, arg) ) if applicable_operator?(operator, arg)
|
|
135
136
|
end
|
|
136
137
|
element
|
|
137
138
|
end
|
|
138
139
|
|
|
140
|
+
def applicable_operator? operator, arg
|
|
141
|
+
!arg.nil? || NULLABLE_OPERATORS.include?(operator)
|
|
142
|
+
end
|
|
143
|
+
|
|
139
144
|
def apply_or_selector element, value
|
|
140
145
|
selectors = value.collect{|v| make_selector v }.compact
|
|
141
146
|
element.when( Activecube::Query::Selector.or(selectors) )
|
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.22
|
|
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:
|
|
11
|
+
date: 2021-11-24 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: []
|