stardust_rails 0.1.1 → 0.1.2
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/lib/stardust.rb +1 -2
- data/lib/stardust/engine.rb +1 -8
- data/lib/stardust/graphql.rb +7 -3
- data/lib/stardust/graphql/collector.rb +17 -8
- data/lib/stardust/graphql/scalar.rb +1 -1
- data/lib/stardust/graphql/union.rb +1 -1
- data/lib/stardust/version.rb +1 -1
- metadata +1 -2
- data/lib/stardust/graphql/schema.rb +0 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1f9ed3ccdac95798e18abee0c7600b0c189188a5b291705cc907e4f05af4a33b
|
|
4
|
+
data.tar.gz: '08964765b051cdf70d4350b8e4058bfe53e4424a77776bd4dd18ae76260940aa'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 67e99d6712a56b22f803a2b7a6e1b29e700b025dd340f70ad3c3caaf828b5497ce7a5bad2b363c6e297de9f29d95c519d44b15334068b131cc14a7f438eb85b7
|
|
7
|
+
data.tar.gz: 84fd071401395195e31a304553bddf5c3400b05d0a2a30b7631333d69c8e33bfd01bca9e86c1f72ad04011151c94e046ebda91f5965f2312eecf1222a79db99c
|
data/lib/stardust.rb
CHANGED
data/lib/stardust/engine.rb
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
require "graphql/rails_logger"
|
|
2
2
|
require 'apollo_upload_server/middleware'
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
class Engine < ::Rails::Engine
|
|
6
|
-
|
|
7
|
-
config.autoload_paths += Dir[
|
|
8
|
-
"#{config.root}/app/**/",
|
|
9
|
-
"#{config.root}/lib/**/"
|
|
10
|
-
]
|
|
4
|
+
class Stardust::Engine < ::Rails::Engine
|
|
11
5
|
|
|
12
6
|
DIRS = [
|
|
13
7
|
"app/graph/types",
|
|
@@ -47,5 +41,4 @@ module Stardust
|
|
|
47
41
|
}
|
|
48
42
|
end
|
|
49
43
|
end
|
|
50
|
-
end
|
|
51
44
|
end
|
data/lib/stardust/graphql.rb
CHANGED
|
@@ -4,7 +4,6 @@ require "graphql/rails_logger"
|
|
|
4
4
|
require "graphql/batch"
|
|
5
5
|
|
|
6
6
|
require "stardust/graphql/types"
|
|
7
|
-
require "stardust/graphql/schema"
|
|
8
7
|
|
|
9
8
|
require "stardust/graphql/dsl"
|
|
10
9
|
require "stardust/graphql/types/dsl"
|
|
@@ -17,9 +16,14 @@ module Stardust
|
|
|
17
16
|
end
|
|
18
17
|
end
|
|
19
18
|
|
|
19
|
+
require "stardust/graphql/collector"
|
|
20
|
+
require "stardust/graphql/configuration"
|
|
20
21
|
require "stardust/graphql/field"
|
|
22
|
+
require "stardust/graphql/input_object"
|
|
23
|
+
require "stardust/graphql/mutation"
|
|
21
24
|
require "stardust/graphql/object"
|
|
22
|
-
require "stardust/graphql/
|
|
25
|
+
require "stardust/graphql/query"
|
|
23
26
|
require "stardust/graphql/scalar"
|
|
24
|
-
require "stardust/graphql/
|
|
27
|
+
require "stardust/graphql/union"
|
|
28
|
+
require "stardust/graphql/extensions/authorize"
|
|
25
29
|
require "stardust/graphql/input_object"
|
|
@@ -34,21 +34,21 @@ module Stardust
|
|
|
34
34
|
rescue NotImplementedError
|
|
35
35
|
klass.graphql_name(type.to_s.camelize)
|
|
36
36
|
end
|
|
37
|
-
|
|
37
|
+
|
|
38
38
|
::Stardust::GraphQL::Types.const_set("#{type.to_s.camelize}", klass)
|
|
39
39
|
@@__types__[type] = "Stardust::GraphQL::Types::#{type.to_s.camelize}".constantize
|
|
40
40
|
end
|
|
41
41
|
|
|
42
42
|
def self.clear_definitions!
|
|
43
|
+
|
|
44
|
+
@@__defined_types__.each do |type|
|
|
45
|
+
Stardust::GraphQL::Types.send(:remove_const, type)
|
|
46
|
+
end
|
|
47
|
+
|
|
43
48
|
@@__defined_types__ = []
|
|
44
49
|
@@__types__ = {}.merge(FIXED_TYPES)
|
|
45
50
|
@@__queries__ = {}
|
|
46
51
|
@@__mutations__ = {}
|
|
47
|
-
|
|
48
|
-
::Stardust::GraphQL.send(:remove_const, "Types")
|
|
49
|
-
::Stardust::GraphQL.send(:remove_const, "Schema")
|
|
50
|
-
load 'stardust/graphql/types'
|
|
51
|
-
load 'stardust/graphql/schema'
|
|
52
52
|
end
|
|
53
53
|
|
|
54
54
|
def add_query(name, query:)
|
|
@@ -102,6 +102,15 @@ module Stardust
|
|
|
102
102
|
end
|
|
103
103
|
end
|
|
104
104
|
|
|
105
|
+
## Here we define a new graphql type
|
|
106
|
+
if Stardust::GraphQL.const_defined?("Schema")
|
|
107
|
+
Stardust::GraphQL.send(:remove_const, "Schema")
|
|
108
|
+
end
|
|
109
|
+
klass = Class.new(::GraphQL::Schema) do
|
|
110
|
+
use ::GraphQL::Batch
|
|
111
|
+
end
|
|
112
|
+
Stardust::GraphQL.const_set("Schema", klass)
|
|
113
|
+
|
|
105
114
|
query_class = Class.new(::Stardust::GraphQL::Object)
|
|
106
115
|
query_class.graphql_name("QueryRoot")
|
|
107
116
|
@@__queries__.each do |name, query|
|
|
@@ -136,7 +145,7 @@ module Stardust
|
|
|
136
145
|
|
|
137
146
|
TEXT
|
|
138
147
|
end
|
|
139
|
-
Schema.query(query_class)
|
|
148
|
+
Stardust::GraphQL::Schema.query(query_class)
|
|
140
149
|
|
|
141
150
|
|
|
142
151
|
mutation_class = Class.new(::GraphQL::Schema::Object)
|
|
@@ -154,7 +163,7 @@ module Stardust
|
|
|
154
163
|
TEXT
|
|
155
164
|
end
|
|
156
165
|
end
|
|
157
|
-
Schema.mutation(mutation_class)
|
|
166
|
+
Stardust::GraphQL::Schema.mutation(mutation_class)
|
|
158
167
|
end
|
|
159
168
|
end
|
|
160
169
|
end
|
data/lib/stardust/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: stardust_rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bradley Wittenbrook
|
|
@@ -132,7 +132,6 @@ files:
|
|
|
132
132
|
- lib/stardust/graphql/object.rb
|
|
133
133
|
- lib/stardust/graphql/query.rb
|
|
134
134
|
- lib/stardust/graphql/scalar.rb
|
|
135
|
-
- lib/stardust/graphql/schema.rb
|
|
136
135
|
- lib/stardust/graphql/types.rb
|
|
137
136
|
- lib/stardust/graphql/types/dsl.rb
|
|
138
137
|
- lib/stardust/graphql/union.rb
|