graphiform 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/graphiform/skeleton.rb +70 -82
- data/lib/graphiform/version.rb +1 -1
- data/lib/graphiform.rb +2 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fc3e0cf5b5240d32be9aeb6d008bd81c56e8b5cee03e1bda37b080ad56fbf1f
|
4
|
+
data.tar.gz: cfaf0727fedb282ab4ee4bfb58c1fcb0529e0c3c48eb51331c18e76d05651870
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04b52523d7a06c73d7241259053cb4a6e3c090d70878f4e30b598800cc02492f5eae4e1b70bb7801a29a419a725ce8196b03dbbc015c5fdc748a9ecba18aad22
|
7
|
+
data.tar.gz: 4c1cf12e92d5cc1c74b235a76baeb3b2be47044dd81c703e59fea199268094b34e98f85bb83d3c8b4e58ae98221bd7449e72e30f5392104e6ac0aaa72c75bccd
|
data/lib/graphiform/skeleton.rb
CHANGED
@@ -2,106 +2,94 @@ require 'graphql'
|
|
2
2
|
require 'graphiform/helpers'
|
3
3
|
|
4
4
|
module Graphiform
|
5
|
-
|
6
|
-
|
7
|
-
Module.new
|
8
|
-
end
|
5
|
+
def self.create_skeleton
|
6
|
+
return if defined? @skeleton_created
|
9
7
|
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
# Types
|
9
|
+
Helpers.get_const_or_create('Types') do
|
10
|
+
Module.new
|
11
|
+
end
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
Helpers.get_const_or_create('BaseObject', ::Types) do
|
14
|
+
Class.new(::GraphQL::Schema::Object)
|
15
|
+
end
|
17
16
|
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
Helpers.get_const_or_create('BaseEdge', ::Types) do
|
18
|
+
Class.new(::GraphQL::Types::Relay::BaseEdge)
|
19
|
+
end
|
21
20
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
end
|
21
|
+
Helpers.get_const_or_create('BaseConnection', ::Types) do
|
22
|
+
Class.new(::GraphQL::Types::Relay::BaseConnection)
|
23
|
+
end
|
26
24
|
|
27
|
-
|
28
|
-
|
29
|
-
|
25
|
+
# Inputs
|
26
|
+
Helpers.get_const_or_create('Inputs') do
|
27
|
+
Module.new
|
28
|
+
end
|
30
29
|
|
31
|
-
|
32
|
-
|
33
|
-
|
30
|
+
Helpers.get_const_or_create('BaseInput', ::Inputs) do
|
31
|
+
Class.new(::GraphQL::Schema::InputObject)
|
32
|
+
end
|
34
33
|
|
35
|
-
|
36
|
-
|
37
|
-
|
34
|
+
Helpers.get_const_or_create('Filters', ::Inputs) do
|
35
|
+
Module.new
|
36
|
+
end
|
38
37
|
|
39
|
-
|
40
|
-
|
41
|
-
|
38
|
+
Helpers.get_const_or_create('BaseFilter', ::Inputs::Filters) do
|
39
|
+
Class.new(::GraphQL::Schema::InputObject)
|
40
|
+
end
|
42
41
|
|
43
|
-
|
44
|
-
|
45
|
-
|
42
|
+
Helpers.get_const_or_create('Sorts', ::Inputs) do
|
43
|
+
Module.new
|
44
|
+
end
|
46
45
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
end
|
46
|
+
Helpers.get_const_or_create('BaseSort', ::Inputs::Sorts) do
|
47
|
+
Class.new(::GraphQL::Schema::InputObject)
|
48
|
+
end
|
51
49
|
|
52
|
-
|
53
|
-
|
54
|
-
|
50
|
+
# Resolvers
|
51
|
+
Helpers.get_const_or_create('Resolvers') do
|
52
|
+
Module.new
|
53
|
+
end
|
55
54
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
end
|
55
|
+
Helpers.get_const_or_create('BaseResolver', ::Resolvers) do
|
56
|
+
Class.new(::GraphQL::Schema::Resolver)
|
57
|
+
end
|
60
58
|
|
61
|
-
|
62
|
-
|
63
|
-
|
59
|
+
# Queries
|
60
|
+
Helpers.get_const_or_create('Queries', ::Resolvers) do
|
61
|
+
Module.new
|
62
|
+
end
|
64
63
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
end
|
64
|
+
Helpers.get_const_or_create('BaseQuery', ::Resolvers::Queries) do
|
65
|
+
Class.new(::GraphQL::Schema::Resolver)
|
66
|
+
end
|
69
67
|
|
70
|
-
|
71
|
-
|
72
|
-
|
68
|
+
# Connection Queries
|
69
|
+
Helpers.get_const_or_create('ConnectionQueries', ::Resolvers) do
|
70
|
+
Module.new
|
71
|
+
end
|
73
72
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
end
|
73
|
+
Helpers.get_const_or_create('BaseQuery', ::Resolvers::ConnectionQueries) do
|
74
|
+
Class.new(::GraphQL::Schema::Resolver)
|
75
|
+
end
|
78
76
|
|
79
|
-
|
80
|
-
|
81
|
-
|
77
|
+
# Enums
|
78
|
+
Helpers.get_const_or_create('Enums') do
|
79
|
+
Module.new
|
80
|
+
end
|
82
81
|
|
83
|
-
|
84
|
-
|
85
|
-
value 'ASC', 'Sort results in ascending order'
|
86
|
-
value 'DESC', 'Sort results in descending order'
|
82
|
+
Helpers.get_const_or_create('BaseEnum', ::Enums) do
|
83
|
+
Class.new(::GraphQL::Schema::Enum)
|
87
84
|
end
|
85
|
+
|
86
|
+
Helpers.get_const_or_create('Sort', ::Enums) do
|
87
|
+
Class.new(::Enums::BaseEnum) do
|
88
|
+
value 'ASC', 'Sort results in ascending order'
|
89
|
+
value 'DESC', 'Sort results in descending order'
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
@skeleton_created = true
|
88
94
|
end
|
89
95
|
end
|
90
|
-
|
91
|
-
# Types
|
92
|
-
# BaseObject
|
93
|
-
# BaseEdge
|
94
|
-
# BaseConnection
|
95
|
-
# Inputs
|
96
|
-
# BaseInput
|
97
|
-
# Filters
|
98
|
-
# BaseFilter
|
99
|
-
# Resolvers
|
100
|
-
# BaseResolver
|
101
|
-
# ConnectionQueries
|
102
|
-
|
103
|
-
# Helpers.get_const_or_create('Types') do
|
104
|
-
# Class.new(::Types::BaseObject) do
|
105
|
-
# graphql_name demodulized_name
|
106
|
-
# end
|
107
|
-
# end
|
data/lib/graphiform/version.rb
CHANGED
data/lib/graphiform.rb
CHANGED