rails-graphql-generator 0.0.1 → 0.0.2
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: abf0f104118448b4b242bffe563fe30c282a9e42
|
4
|
+
data.tar.gz: 2519d5a582124bdd8067a8c7c80f692ca7878852
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7edbd271e42b8bf3ff0bea85efaf7faccfc4d7101c3d7cbd74cefae6ff4fa5e0a50d692973f41203f0d9fdcfda282efbe83b37b038f960f49be8a282dac24ef9
|
7
|
+
data.tar.gz: 02c7a18a8f8fc88a35db3b6025bfefb434c5ec94787e494f744e2a5190c683bda6d17c9294446250ad4e3b4c9ab918b259ff03b13572e6bfa53fb6930ae43172
|
@@ -57,8 +57,7 @@ end
|
|
57
57
|
|
58
58
|
begin
|
59
59
|
if models.include? association_klass.classify.constantize
|
60
|
-
|
61
|
-
inject_into_file type_path(model), before: "# End of fields\n" do <<-FILE
|
60
|
+
inject_into_file type_path(model), before: "# End of fields\n" do <<-FILE
|
62
61
|
field :#{ast.to_s} do
|
63
62
|
type -> { #{model.reflect_on_association(ast).class_name}Type }
|
64
63
|
|
@@ -67,19 +66,7 @@ end
|
|
67
66
|
}
|
68
67
|
end
|
69
68
|
|
70
|
-
|
71
|
-
end
|
72
|
-
else
|
73
|
-
inject_into_file type_path(model), before: "# End of fields\n" do <<-FILE
|
74
|
-
field :#{ast.to_s} do
|
75
|
-
type -> #{model.reflect_on_association(ast).class_name}Type
|
76
|
-
|
77
|
-
resolve -> (#{singular_route_key(model)}, args, ctx) {
|
78
|
-
#{singular_route_key(model)}.#{ast.to_s}
|
79
|
-
}
|
80
|
-
end
|
81
|
-
FILE
|
82
|
-
end
|
69
|
+
FILE
|
83
70
|
end
|
84
71
|
end
|
85
72
|
rescue => ex
|
@@ -9,7 +9,7 @@ class GraphQlController < ApplicationController
|
|
9
9
|
variables = params[:variables]
|
10
10
|
end
|
11
11
|
|
12
|
-
render json: GraphQL::Query.new(RelaySchema, params[:query], variables: variables
|
12
|
+
render json: GraphQL::Query.new(RelaySchema, params[:query], variables: variables).result
|
13
13
|
end
|
14
14
|
|
15
15
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-graphql-generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Muhammet
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|