graphiti_gql 0.2.34 → 0.2.35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/graphiti_gql/schema/fields/to_many.rb +3 -2
- data/lib/graphiti_gql/schema/query.rb +0 -17
- data/lib/graphiti_gql/schema.rb +1 -0
- data/lib/graphiti_gql/version.rb +1 -1
- data/lib/graphiti_gql.rb +0 -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: 5e404a080bb36a50e41942d18eadaa0813c92eef0c965adf07dcddb80218b151
|
4
|
+
data.tar.gz: 20f073ab99227e37bdf357511b58e96172994682d5d3dcd881abdb8d4f1a2bca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba6307b54c651e5367555290ee756db75c3c0a9f6504167f16968d564b88bdd6fb5c7d7e8cc73982d321157ad59039688d107f834ab61078b350783e16259a5d
|
7
|
+
data.tar.gz: 1c3e2611f9fd313097b807b0b09082d037c34a9ffc87ce749b36b3283a9d98c428374fa64d1e4eca4d0c47b9918b2f9738b4e1054177c55e9e881ff6eda9c457
|
@@ -4,6 +4,7 @@ module GraphitiGql
|
|
4
4
|
class ToMany
|
5
5
|
def initialize(sideload, sideload_type)
|
6
6
|
@sideload = sideload
|
7
|
+
@sideload_resource = Schema.registry.get(sideload.resource.class)[:resource]
|
7
8
|
@sideload_type = sideload_type
|
8
9
|
@connection_type = find_or_build_connection
|
9
10
|
end
|
@@ -19,9 +20,9 @@ module GraphitiGql
|
|
19
20
|
field_type,
|
20
21
|
**opts
|
21
22
|
unless has_one?
|
22
|
-
field.extension(RelayConnectionExtension, resource: @
|
23
|
+
field.extension(RelayConnectionExtension, resource: @sideload_resource)
|
23
24
|
end
|
24
|
-
ListArguments.new(@
|
25
|
+
ListArguments.new(@sideload_resource, @sideload).apply(field)
|
25
26
|
_sideload = @sideload
|
26
27
|
type.define_method(@sideload.name) do |**arguments|
|
27
28
|
Util.is_readable_sideload!(_sideload)
|
@@ -8,10 +8,7 @@ module GraphitiGql
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def build
|
11
|
-
@resources.each { |resource| ResourceType.new(resource).build }
|
12
11
|
define_entrypoints
|
13
|
-
add_value_objects
|
14
|
-
add_relationships
|
15
12
|
@query_class
|
16
13
|
end
|
17
14
|
|
@@ -29,20 +26,6 @@ module GraphitiGql
|
|
29
26
|
end
|
30
27
|
end
|
31
28
|
end
|
32
|
-
|
33
|
-
def add_relationships
|
34
|
-
registry.resource_types.each do |registered|
|
35
|
-
resource, type = registered[:resource], registered[:type]
|
36
|
-
ResourceType.add_relationships(resource, type)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
def add_value_objects
|
41
|
-
registry.resource_types(value_objects: false).each do |registered|
|
42
|
-
resource, type = registered[:resource], registered[:type]
|
43
|
-
ResourceType.add_value_objects(resource, type)
|
44
|
-
end
|
45
|
-
end
|
46
29
|
end
|
47
30
|
end
|
48
31
|
end
|
data/lib/graphiti_gql/schema.rb
CHANGED
@@ -119,6 +119,7 @@ module GraphitiGql
|
|
119
119
|
|
120
120
|
def generate
|
121
121
|
klass = Class.new(::GraphitiGql.config.base_schema || ::GraphQL::Schema)
|
122
|
+
return if klass.query
|
122
123
|
# TODO inherit from klass.query if exists
|
123
124
|
klass.query(Query.new(@resources).build)
|
124
125
|
klass.use(GraphQL::Batch)
|
data/lib/graphiti_gql/version.rb
CHANGED
data/lib/graphiti_gql.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphiti_gql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.35
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lee Richmond
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-09-
|
11
|
+
date: 2022-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphql
|