graphql_rails 0.2.0 → 0.2.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/Gemfile.lock +2 -2
- data/lib/graphql_rails/controller/action.rb +5 -9
- data/lib/graphql_rails/controller/controller_function.rb +7 -3
- data/lib/graphql_rails/router/route.rb +1 -5
- data/lib/graphql_rails/router/schema_builder.rb +1 -1
- data/lib/graphql_rails/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: 97ae2d35ab34e958eb13f188854ae609736cbdff918eafb289404b9736dffc9d
|
4
|
+
data.tar.gz: 75ac9efeea9bf884a0ea424a40b04b293f41d25cb35a64c40c127101e7e681db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e01ee3d1a638af00eea8f03be9b889081bccbe1b77a1d7b2123494bfb5b7c7f3cb3c6f5c68318203649333240514f3b5b2fa15a5760720b383e876a2143346e
|
7
|
+
data.tar.gz: 357decd9aa77806ae4cee99bae7c8257263d5ff3ef77a42daf2aa77d17481df038fab7e8ad0a5b2d80e482b90a9be32a3bf7ab182a1cf3d41e022e0d8212e4ed
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
graphql_rails (0.2.
|
4
|
+
graphql_rails (0.2.1)
|
5
5
|
activesupport (>= 4)
|
6
6
|
graphql (~> 1)
|
7
7
|
|
@@ -29,7 +29,7 @@ GEM
|
|
29
29
|
concurrent-ruby (1.0.5)
|
30
30
|
diff-lcs (1.3)
|
31
31
|
docile (1.3.0)
|
32
|
-
graphql (1.
|
32
|
+
graphql (1.8.0)
|
33
33
|
i18n (1.0.1)
|
34
34
|
concurrent-ruby (~> 1.0)
|
35
35
|
json (2.1.0)
|
@@ -24,7 +24,7 @@ module GraphqlRails
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def name
|
27
|
-
@name ||=
|
27
|
+
@name ||= action_relative_path.split('#').last
|
28
28
|
end
|
29
29
|
|
30
30
|
private
|
@@ -45,12 +45,8 @@ module GraphqlRails
|
|
45
45
|
type
|
46
46
|
end
|
47
47
|
|
48
|
-
def
|
49
|
-
route.
|
50
|
-
end
|
51
|
-
|
52
|
-
def module_name
|
53
|
-
route.module_name
|
48
|
+
def action_relative_path
|
49
|
+
route.relative_path
|
54
50
|
end
|
55
51
|
|
56
52
|
def action_config
|
@@ -58,11 +54,11 @@ module GraphqlRails
|
|
58
54
|
end
|
59
55
|
|
60
56
|
def namespaced_controller_name
|
61
|
-
[module_name, controller_name].reject(&:empty?).join('/')
|
57
|
+
[route.module_name, controller_name].reject(&:empty?).join('/')
|
62
58
|
end
|
63
59
|
|
64
60
|
def controller_name
|
65
|
-
@controller_name ||=
|
61
|
+
@controller_name ||= action_relative_path.split('#').first
|
66
62
|
end
|
67
63
|
|
68
64
|
def action_model
|
@@ -11,10 +11,10 @@ module GraphqlRails
|
|
11
11
|
# accepts path of given format "controller_name#action"
|
12
12
|
attr_reader :type
|
13
13
|
|
14
|
-
def initialize(controller
|
14
|
+
def initialize(controller:, action_name:, type:)
|
15
15
|
@controller = controller
|
16
16
|
@action_name = action_name
|
17
|
-
@type =
|
17
|
+
@type = type
|
18
18
|
end
|
19
19
|
|
20
20
|
def self.from_route(route)
|
@@ -26,7 +26,11 @@ module GraphqlRails
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
action_function.new(
|
29
|
+
action_function.new(
|
30
|
+
controller: action.controller,
|
31
|
+
action_name: action.name,
|
32
|
+
type: action.return_type
|
33
|
+
)
|
30
34
|
end
|
31
35
|
|
32
36
|
def call(object, inputs, ctx)
|
@@ -6,7 +6,7 @@ module GraphqlRails
|
|
6
6
|
class Router
|
7
7
|
# Generic class for any type graphql action. Should not be used directly
|
8
8
|
class Route
|
9
|
-
attr_reader :name, :module_name, :on
|
9
|
+
attr_reader :name, :module_name, :on, :relative_path
|
10
10
|
|
11
11
|
def initialize(name, to:, on:, **options)
|
12
12
|
@name = name.to_s.camelize(:lower)
|
@@ -31,10 +31,6 @@ module GraphqlRails
|
|
31
31
|
def options
|
32
32
|
{ function: Controller::ControllerFunction.build(path) }
|
33
33
|
end
|
34
|
-
|
35
|
-
private
|
36
|
-
|
37
|
-
attr_reader :relative_path
|
38
34
|
end
|
39
35
|
end
|
40
36
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Povilas Jurčys
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphql
|