graphql-voyager-rails 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cee59c5794c83c912209ef2bcd44d35ef7c44b35255af4e7c52090fce6946a80
4
- data.tar.gz: 7e52cacb58d45cb3d81fe9b8190d88b2a592525777d3bf18b979a568fdb76dd5
3
+ metadata.gz: f8d2c4764c4e9f10422bf6d750fd4301c7c87a912cb64c8a78b2878bc80b472b
4
+ data.tar.gz: 149f971001ae074615d5d203ca2918c3eaa465218d1b5d8b4472139c8e635a11
5
5
  SHA512:
6
- metadata.gz: 6cb083fa476b5c789d3796f49672bde77ba95bb3679bdcc72d9e9e59105f1d67a1d8be995154c890cb2f630c51f0f5557368cf88b6f1ba8df72b5460e3e58fc5
7
- data.tar.gz: 2b92118cb3573da2a1416d2c4dce5a028a21fdb4deb41093bae66230afe527a11ce79cd3846e71340e4010d9f176405fe1022f62e8955cc13da213c6cec206f2
6
+ metadata.gz: a6e75b2ccba08ff04cbb6b7e0303024c3530a999183844721d82ae14a324e842acd0c210d5096c5f921877d444f7ad1a1a486bd560444a3d5e861232537cb2cd
7
+ data.tar.gz: 994136b90bdb8f11db30de11cc62bd4accf295c93a5260c3ea1b4cb402f978b78a89d2d94c7208a345619fb6294d9fd1f7fddb8e626b892f48f20c5a5729e1ca
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module GraphQL
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 GraphQL::Voyager::Rails::Engine|)
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: <%= GraphQL::Voyager::Rails.config.resolve_headers(self).to_json.html_safe %>,
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) {
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- GraphQL::Voyager::Rails::Engine.routes.draw do
3
+ Graphql::Voyager::Rails::Engine.routes.draw do
4
4
  get "/" => "explorers#show"
5
5
  end
@@ -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 GraphQL
8
+ module Graphql
20
9
  module Voyager
21
10
  module Rails
22
11
  class << self
@@ -3,7 +3,7 @@
3
3
  # Originally based on GrapiQL Rails Config
4
4
  # https://github.com/rmosolgo/graphiql-rails/blob/5770e774f9da754aa8c1eee5651d6c663ca8e2a2/lib/graphiql/rails/config.rb
5
5
 
6
- module GraphQL
6
+ module Graphql
7
7
  module Voyager
8
8
  module Rails
9
9
  class Config
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module GraphQL
3
+ module Graphql
4
4
  module Voyager
5
5
  module Rails
6
6
  class Engine < ::Rails::Engine
7
- isolate_namespace GraphQL::Voyager::Rails
7
+ isolate_namespace Graphql::Voyager::Rails
8
8
  end
9
9
  end
10
10
  end
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module GraphQL
3
+ module Graphql
4
4
  module Voyager
5
5
  module Rails
6
- VERSION = '1.0.2'
6
+ VERSION = '1.0.3'
7
7
  end
8
8
  end
9
9
  end
@@ -2,16 +2,16 @@
2
2
 
3
3
  require 'test_helper'
4
4
 
5
- module GraphQL
5
+ module Graphql
6
6
  module Voyager
7
7
  module Rails
8
8
  class ExplorersControllerTest < ActionController::TestCase
9
9
  setup do
10
- @routes = GraphQL::Voyager::Rails::Engine.routes
10
+ @routes = Graphql::Voyager::Rails::Engine.routes
11
11
  end
12
12
 
13
13
  teardown do
14
- GraphQL::Voyager::Rails.config.headers = {}
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
- GraphQL::Voyager::Rails.config.headers['Nonsense-Header'] = ->(_view_ctx) { 'Value' }
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\"))
@@ -1,3 +1,3 @@
1
1
  Rails.application.routes.draw do
2
- mount GraphQL::Voyager::Rails::Engine => "/graphql-voyager-rails"
2
+ mount Graphql::Voyager::Rails::Engine => "/graphql-voyager-rails"
3
3
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "test_helper"
4
4
 
5
- module GraphQL
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 = GraphQL::Voyager::Rails::Config.new
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 GraphQL
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 GraphQL::Voyager::Rails::Engine
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 GraphQL
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, GraphQL::Voyager::Rails
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.2
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-14 00:00:00.000000000 Z
11
+ date: 2020-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties