graphql-voyager-rails 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/graphql/voyager/rails/explorers_controller.rb +2 -2
- data/app/views/graphql/voyager/rails/explorers/show.html.erb +1 -1
- data/config/routes.rb +1 -1
- data/lib/graphql/voyager/rails.rb +1 -12
- data/lib/graphql/voyager/rails/config.rb +1 -1
- data/lib/graphql/voyager/rails/engine.rb +2 -2
- data/lib/graphql/voyager/rails/version.rb +2 -2
- data/test/controllers/graphql/voyager/rails/explorers_controller_test.rb +4 -4
- data/test/dummy/config/routes.rb +1 -1
- data/test/graphql/voyager/config_test.rb +2 -2
- data/test/graphql/voyager/engine_test.rb +2 -2
- data/test/graphql/voyager/rails_test.rb +2 -2
- 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: f8d2c4764c4e9f10422bf6d750fd4301c7c87a912cb64c8a78b2878bc80b472b
|
4
|
+
data.tar.gz: 149f971001ae074615d5d203ca2918c3eaa465218d1b5d8b4472139c8e635a11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6e75b2ccba08ff04cbb6b7e0303024c3530a999183844721d82ae14a324e842acd0c210d5096c5f921877d444f7ad1a1a486bd560444a3d5e861232537cb2cd
|
7
|
+
data.tar.gz: 994136b90bdb8f11db30de11cc62bd4accf295c93a5260c3ea1b4cb402f978b78a89d2d94c7208a345619fb6294d9fd1f7fddb8e626b892f48f20c5a5729e1ca
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
module
|
3
|
+
module Graphql
|
4
4
|
module Voyager
|
5
5
|
module Rails
|
6
6
|
class ExplorersController < ActionController::Base
|
@@ -10,7 +10,7 @@ module GraphQL
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def graphql_endpoint_path
|
13
|
-
params[:graphql_path] || raise(%|You must include `graphql_path: "/my/endpoint"` when mounting
|
13
|
+
params[:graphql_path] || raise(%|You must include `graphql_path: "/my/endpoint"` when mounting Graphql::Voyager::Rails::Engine|)
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
@@ -11,7 +11,7 @@
|
|
11
11
|
function introspectionProvider(introspectionQuery) {
|
12
12
|
return fetch('<%= graphql_endpoint_path %>', {
|
13
13
|
method: 'post',
|
14
|
-
headers: <%=
|
14
|
+
headers: <%= Graphql::Voyager::Rails.config.resolve_headers(self).to_json.html_safe %>,
|
15
15
|
body: JSON.stringify({query: introspectionQuery}),
|
16
16
|
credentials: 'include',
|
17
17
|
}).then(function (response) {
|
data/config/routes.rb
CHANGED
@@ -2,21 +2,10 @@
|
|
2
2
|
|
3
3
|
require "rails"
|
4
4
|
|
5
|
-
if ActiveSupport::Inflector.method(:inflections).arity == 0
|
6
|
-
# Rails 3 does not take a language in inflections.
|
7
|
-
ActiveSupport::Inflector.inflections do |inflect|
|
8
|
-
inflect.acronym("GraphQL")
|
9
|
-
end
|
10
|
-
else
|
11
|
-
ActiveSupport::Inflector.inflections(:en) do |inflect|
|
12
|
-
inflect.acronym("GraphQL")
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
5
|
require "graphql/voyager/rails/engine"
|
17
6
|
require "graphql/voyager/rails/config"
|
18
7
|
|
19
|
-
module
|
8
|
+
module Graphql
|
20
9
|
module Voyager
|
21
10
|
module Rails
|
22
11
|
class << self
|
@@ -2,16 +2,16 @@
|
|
2
2
|
|
3
3
|
require 'test_helper'
|
4
4
|
|
5
|
-
module
|
5
|
+
module Graphql
|
6
6
|
module Voyager
|
7
7
|
module Rails
|
8
8
|
class ExplorersControllerTest < ActionController::TestCase
|
9
9
|
setup do
|
10
|
-
@routes =
|
10
|
+
@routes = Graphql::Voyager::Rails::Engine.routes
|
11
11
|
end
|
12
12
|
|
13
13
|
teardown do
|
14
|
-
|
14
|
+
Graphql::Voyager::Rails.config.headers = {}
|
15
15
|
end
|
16
16
|
|
17
17
|
def graphql_params
|
@@ -26,7 +26,7 @@ module GraphQL
|
|
26
26
|
end
|
27
27
|
|
28
28
|
test 'it renders headers' do
|
29
|
-
|
29
|
+
Graphql::Voyager::Rails.config.headers['Nonsense-Header'] = ->(_view_ctx) { 'Value' }
|
30
30
|
get :show, graphql_params
|
31
31
|
assert_includes(@response.body, %(\"Nonsense-Header\":\"Value\"))
|
32
32
|
assert_includes(@response.body, %(\"X-CSRF-Token\"))
|
data/test/dummy/config/routes.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require "test_helper"
|
4
4
|
|
5
|
-
module
|
5
|
+
module Graphql
|
6
6
|
module Voyager
|
7
7
|
module Rails
|
8
8
|
class ConfigTest < ActiveSupport::TestCase
|
@@ -13,7 +13,7 @@ module GraphQL
|
|
13
13
|
end
|
14
14
|
|
15
15
|
setup do
|
16
|
-
@config =
|
16
|
+
@config = Graphql::Voyager::Rails::Config.new
|
17
17
|
@view_context = MockViewContext.new
|
18
18
|
end
|
19
19
|
|
@@ -2,12 +2,12 @@
|
|
2
2
|
|
3
3
|
require "test_helper"
|
4
4
|
|
5
|
-
module
|
5
|
+
module Graphql
|
6
6
|
module Voyager
|
7
7
|
module Rails
|
8
8
|
class EngineTest < ActiveSupport::TestCase
|
9
9
|
test "it is defined" do
|
10
|
-
assert
|
10
|
+
assert Graphql::Voyager::Rails::Engine
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -2,12 +2,12 @@
|
|
2
2
|
|
3
3
|
require 'test_helper'
|
4
4
|
|
5
|
-
module
|
5
|
+
module Graphql
|
6
6
|
module Voyager
|
7
7
|
module Rails
|
8
8
|
class Test < ActiveSupport::TestCase
|
9
9
|
test "truth" do
|
10
|
-
assert_kind_of Module,
|
10
|
+
assert_kind_of Module, Graphql::Voyager::Rails
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql-voyager-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas McGoey-Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-02-
|
11
|
+
date: 2020-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|