graphiti_gql 0.2.16 → 0.2.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/graphiti_gql/execution_controller.rb +18 -0
- data/lib/graphiti_gql/engine.rb +2 -19
- data/lib/graphiti_gql/version.rb +1 -1
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18a776555ead439b1ddfb5ff28835e1da6c5673b93287379d3cd8de4d366d5b7
|
4
|
+
data.tar.gz: 919983d1eb5ad3653b4a95d22d9ed0f1d46d159fce21b2095746118e7e3bd175
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e70f2ee088082aae875d1f98117e65f9a2daf1c08a752ea79142b3ca371c30c64333b75d4e54d890356a62cc11dcef8a6c7d214936b9ffa94241c893ec672cfb
|
7
|
+
data.tar.gz: 29c371f94406f5b37beb82e6e440f5f52b3bca2345f2cc7b719ecea5f67ce28333a25820c6fd46f87ca540a218e18a6bd24e67e862f1fd6db66ab53203b1241b
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module GraphitiGql
|
2
|
+
class ExecutionController < GraphitiGql.config.application_controller
|
3
|
+
def execute
|
4
|
+
params = request.params # avoid strong_parameters
|
5
|
+
variables = params[:variables] || {}
|
6
|
+
result = GraphitiGql.run params[:query],
|
7
|
+
params[:variables],
|
8
|
+
graphql_context
|
9
|
+
render json: result
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def default_context
|
15
|
+
defined?(:current_user)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/graphiti_gql/engine.rb
CHANGED
@@ -3,27 +3,10 @@ module GraphitiGql
|
|
3
3
|
isolate_namespace GraphitiGql
|
4
4
|
|
5
5
|
# TODO improvable?
|
6
|
-
config.
|
6
|
+
config.to_prepare do
|
7
7
|
# initializer "graphiti_gql.generate_schema" do
|
8
8
|
Dir.glob("#{Rails.root}/app/resources/**/*").each { |f| require(f) }
|
9
9
|
GraphitiGql.schema!
|
10
10
|
end
|
11
|
-
|
12
|
-
initializer "graphiti_gql.define_controller" do
|
13
|
-
app_controller = GraphitiGql.config.application_controller || ::ApplicationController
|
14
|
-
|
15
|
-
# rubocop:disable Lint/ConstantDefinitionInBlock(Standard)
|
16
|
-
class GraphitiGql::ExecutionController < app_controller
|
17
|
-
def execute
|
18
|
-
params = request.params # avoid strong_parameters
|
19
|
-
variables = params[:variables] || {}
|
20
|
-
ctx = respond_to?(:graphql_context) ? graphql_context : {}
|
21
|
-
result = GraphitiGql.run params[:query],
|
22
|
-
params[:variables],
|
23
|
-
ctx
|
24
|
-
render json: result
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
11
|
end
|
29
|
-
end
|
12
|
+
end
|
data/lib/graphiti_gql/version.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.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lee Richmond
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-07-
|
11
|
+
date: 2022-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphql
|
@@ -108,7 +108,7 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '7.0'
|
111
|
-
description:
|
111
|
+
description:
|
112
112
|
email:
|
113
113
|
- richmolj@gmail.com
|
114
114
|
executables: []
|
@@ -124,6 +124,7 @@ files:
|
|
124
124
|
- LICENSE.txt
|
125
125
|
- README.md
|
126
126
|
- Rakefile
|
127
|
+
- app/controllers/graphiti_gql/execution_controller.rb
|
127
128
|
- bin/bundle
|
128
129
|
- bin/byebug
|
129
130
|
- bin/coderay
|
@@ -170,7 +171,7 @@ licenses:
|
|
170
171
|
- MIT
|
171
172
|
metadata:
|
172
173
|
homepage_uri: https://www.graphiti.dev
|
173
|
-
post_install_message:
|
174
|
+
post_install_message:
|
174
175
|
rdoc_options: []
|
175
176
|
require_paths:
|
176
177
|
- lib
|
@@ -185,8 +186,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
185
186
|
- !ruby/object:Gem::Version
|
186
187
|
version: '0'
|
187
188
|
requirements: []
|
188
|
-
rubygems_version: 3.3.
|
189
|
-
signing_key:
|
189
|
+
rubygems_version: 3.0.3.1
|
190
|
+
signing_key:
|
190
191
|
specification_version: 4
|
191
192
|
summary: GraphQL support for Graphiti
|
192
193
|
test_files: []
|