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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8626c94d7e632cf64e3052e0e1edd4fdbcd0aa520c67458a69d0f686dcfab261
4
- data.tar.gz: c06a1caae7f897f315f5c32606e6cc6180531518904fee20e76f2beae4498b7a
3
+ metadata.gz: 4fc3e0cf5b5240d32be9aeb6d008bd81c56e8b5cee03e1bda37b080ad56fbf1f
4
+ data.tar.gz: cfaf0727fedb282ab4ee4bfb58c1fcb0529e0c3c48eb51331c18e76d05651870
5
5
  SHA512:
6
- metadata.gz: 6db928db886d71484bc930d6e42917e1cadbc72e2d6d360aa7c46bf005aa66a0eacb62957d81497d6d01d132ec1be1de85c2da1a76fb8bed372048e262c8316f
7
- data.tar.gz: 2bebd2c05fa86e751e3b7902651fa82071a22a4a43fad562b7af852dafe971d3db0dd275606650bd681b9596326f270d4c07c6b5e380fcdd387dd50288150022
6
+ metadata.gz: 04b52523d7a06c73d7241259053cb4a6e3c090d70878f4e30b598800cc02492f5eae4e1b70bb7801a29a419a725ce8196b03dbbc015c5fdc748a9ecba18aad22
7
+ data.tar.gz: 4c1cf12e92d5cc1c74b235a76baeb3b2be47044dd81c703e59fea199268094b34e98f85bb83d3c8b4e58ae98221bd7449e72e30f5392104e6ac0aaa72c75bccd
@@ -2,106 +2,94 @@ require 'graphql'
2
2
  require 'graphiform/helpers'
3
3
 
4
4
  module Graphiform
5
- # Types
6
- Helpers.get_const_or_create('Types') do
7
- Module.new
8
- end
5
+ def self.create_skeleton
6
+ return if defined? @skeleton_created
9
7
 
10
- Helpers.get_const_or_create('BaseObject', ::Types) do
11
- Class.new(::GraphQL::Schema::Object)
12
- end
8
+ # Types
9
+ Helpers.get_const_or_create('Types') do
10
+ Module.new
11
+ end
13
12
 
14
- Helpers.get_const_or_create('BaseEdge', ::Types) do
15
- Class.new(::GraphQL::Types::Relay::BaseEdge)
16
- end
13
+ Helpers.get_const_or_create('BaseObject', ::Types) do
14
+ Class.new(::GraphQL::Schema::Object)
15
+ end
17
16
 
18
- Helpers.get_const_or_create('BaseConnection', ::Types) do
19
- Class.new(::GraphQL::Types::Relay::BaseConnection)
20
- end
17
+ Helpers.get_const_or_create('BaseEdge', ::Types) do
18
+ Class.new(::GraphQL::Types::Relay::BaseEdge)
19
+ end
21
20
 
22
- # Inputs
23
- Helpers.get_const_or_create('Inputs') do
24
- Module.new
25
- end
21
+ Helpers.get_const_or_create('BaseConnection', ::Types) do
22
+ Class.new(::GraphQL::Types::Relay::BaseConnection)
23
+ end
26
24
 
27
- Helpers.get_const_or_create('BaseInput', ::Inputs) do
28
- Class.new(::GraphQL::Schema::InputObject)
29
- end
25
+ # Inputs
26
+ Helpers.get_const_or_create('Inputs') do
27
+ Module.new
28
+ end
30
29
 
31
- Helpers.get_const_or_create('Filters', ::Inputs) do
32
- Module.new
33
- end
30
+ Helpers.get_const_or_create('BaseInput', ::Inputs) do
31
+ Class.new(::GraphQL::Schema::InputObject)
32
+ end
34
33
 
35
- Helpers.get_const_or_create('BaseFilter', ::Inputs::Filters) do
36
- Class.new(::GraphQL::Schema::InputObject)
37
- end
34
+ Helpers.get_const_or_create('Filters', ::Inputs) do
35
+ Module.new
36
+ end
38
37
 
39
- Helpers.get_const_or_create('Sorts', ::Inputs) do
40
- Module.new
41
- end
38
+ Helpers.get_const_or_create('BaseFilter', ::Inputs::Filters) do
39
+ Class.new(::GraphQL::Schema::InputObject)
40
+ end
42
41
 
43
- Helpers.get_const_or_create('BaseSort', ::Inputs::Sorts) do
44
- Class.new(::GraphQL::Schema::InputObject)
45
- end
42
+ Helpers.get_const_or_create('Sorts', ::Inputs) do
43
+ Module.new
44
+ end
46
45
 
47
- # Resolvers
48
- Helpers.get_const_or_create('Resolvers') do
49
- Module.new
50
- end
46
+ Helpers.get_const_or_create('BaseSort', ::Inputs::Sorts) do
47
+ Class.new(::GraphQL::Schema::InputObject)
48
+ end
51
49
 
52
- Helpers.get_const_or_create('BaseResolver', ::Resolvers) do
53
- Class.new(::GraphQL::Schema::Resolver)
54
- end
50
+ # Resolvers
51
+ Helpers.get_const_or_create('Resolvers') do
52
+ Module.new
53
+ end
55
54
 
56
- # Queries
57
- Helpers.get_const_or_create('Queries', ::Resolvers) do
58
- Module.new
59
- end
55
+ Helpers.get_const_or_create('BaseResolver', ::Resolvers) do
56
+ Class.new(::GraphQL::Schema::Resolver)
57
+ end
60
58
 
61
- Helpers.get_const_or_create('BaseQuery', ::Resolvers::Queries) do
62
- Class.new(::GraphQL::Schema::Resolver)
63
- end
59
+ # Queries
60
+ Helpers.get_const_or_create('Queries', ::Resolvers) do
61
+ Module.new
62
+ end
64
63
 
65
- # Connection Queries
66
- Helpers.get_const_or_create('ConnectionQueries', ::Resolvers) do
67
- Module.new
68
- end
64
+ Helpers.get_const_or_create('BaseQuery', ::Resolvers::Queries) do
65
+ Class.new(::GraphQL::Schema::Resolver)
66
+ end
69
67
 
70
- Helpers.get_const_or_create('BaseQuery', ::Resolvers::ConnectionQueries) do
71
- Class.new(::GraphQL::Schema::Resolver)
72
- end
68
+ # Connection Queries
69
+ Helpers.get_const_or_create('ConnectionQueries', ::Resolvers) do
70
+ Module.new
71
+ end
73
72
 
74
- # Enums
75
- Helpers.get_const_or_create('Enums') do
76
- Module.new
77
- end
73
+ Helpers.get_const_or_create('BaseQuery', ::Resolvers::ConnectionQueries) do
74
+ Class.new(::GraphQL::Schema::Resolver)
75
+ end
78
76
 
79
- Helpers.get_const_or_create('BaseEnum', ::Enums) do
80
- Class.new(::GraphQL::Schema::Enum)
81
- end
77
+ # Enums
78
+ Helpers.get_const_or_create('Enums') do
79
+ Module.new
80
+ end
82
81
 
83
- Helpers.get_const_or_create('Sort', ::Enums) do
84
- Class.new(::Enums::BaseEnum) do
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
@@ -1,3 +1,3 @@
1
1
  module Graphiform
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.1.1'.freeze
3
3
  end
data/lib/graphiform.rb CHANGED
@@ -9,6 +9,8 @@ require 'graphiform/fields'
9
9
  module Graphiform
10
10
  def self.included(base)
11
11
  base.class_eval do
12
+ Graphiform.create_skeleton
13
+
12
14
  include Scopiform
13
15
 
14
16
  include Graphiform::ActiveRecordHelpers
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphiform
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - jayce.pulsipher