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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 535af0267b130ee480022a9058880a17f742ec6aa2209cc2b1d9991a82f9afbc
4
- data.tar.gz: 43c9d8f5c3ff6147776d71741a2a24996b300fa75c3c495f2a4cb00fb11a14ca
3
+ metadata.gz: 18a776555ead439b1ddfb5ff28835e1da6c5673b93287379d3cd8de4d366d5b7
4
+ data.tar.gz: 919983d1eb5ad3653b4a95d22d9ed0f1d46d159fce21b2095746118e7e3bd175
5
5
  SHA512:
6
- metadata.gz: f5a0ea00caf0626444fd452c6502c07367cca9f579b561fd97ef2f615a6467fb415c82de9782f8d2640b567f9aeea90495e5cebb19533b564b2282afed25846b
7
- data.tar.gz: 7cdf9e78135dd6257ec9226256d7242af74347762a4d22e4b7f1563f330fd0245b0326e164177fea524338d6c7b95f63f6c29bf13fa7e8e267aabe12affc325a
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
@@ -3,27 +3,10 @@ module GraphitiGql
3
3
  isolate_namespace GraphitiGql
4
4
 
5
5
  # TODO improvable?
6
- config.after_initialize do
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
@@ -1,3 +1,3 @@
1
1
  module GraphitiGql
2
- VERSION = "0.2.16"
2
+ VERSION = "0.2.17"
3
3
  end
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.16
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-26 00:00:00.000000000 Z
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.7
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: []