rack-graphql 0.4.0 → 0.5.0

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: f1f6210f9dd519a4d0126f0233030a78dd9bcaa7c3d461cbe0444dafb71b9390
4
- data.tar.gz: aa3f41e2f0630c77f0863c29299dac49c1ac54ec35f43ce4c18b6725755c0955
3
+ metadata.gz: 35f7fbe9c74f115820b227518de4ff12f0de6f91165915cbd8e6bb94bd84fe7b
4
+ data.tar.gz: eff9b16ee494fd6eca62d2bcf3153211e9751265ed41cba758f3ce99a3077976
5
5
  SHA512:
6
- metadata.gz: a873134d698b5e0841a38d81a8ea91c876b396f194b5774b4dbad66ce302b1fcc5cb16defefd71a41a445b37cf44b6202187f2528ad12dcc4820c57f1681dc03
7
- data.tar.gz: 799751d5575822fe3a8553779ed4bd7a24d717344065b39d98c4cc9f7066e2d6432fc63caa02f4a435555e47fb61f0dc39f692e50f89e73ef4c6456010491b08
6
+ metadata.gz: 85960db3390a2d8ef721ecdb1a26c829a66b293c83c63e72da6bf05783782c5c6d256c97a485ca5da60b9bbad14e652a40e5f1e002845bcd1a09d75adddec0be
7
+ data.tar.gz: e917ff8286e0c806db62e833f1b5bc3ca282a77fd2a6b0dbad2ca56865d8764a431158ea51b89ec3ff0005e920084a863e2ae078a6706e3d4ebd95c3397cc504
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rack-graphql (0.4.0)
4
+ rack-graphql (0.5.0)
5
5
  graphql (>= 1.9.0)
6
6
  multi_json
7
7
  rack (>= 2.0.0)
@@ -12,8 +12,8 @@ GEM
12
12
  ast (2.4.0)
13
13
  coderay (1.1.2)
14
14
  diff-lcs (1.3)
15
- graphql (1.9.6)
16
- jaro_winkler (1.5.2)
15
+ graphql (1.9.7)
16
+ jaro_winkler (1.5.3)
17
17
  method_source (0.9.2)
18
18
  multi_json (1.13.1)
19
19
  parallel (1.17.0)
@@ -31,7 +31,7 @@ GEM
31
31
  rspec-core (~> 3.8.0)
32
32
  rspec-expectations (~> 3.8.0)
33
33
  rspec-mocks (~> 3.8.0)
34
- rspec-core (3.8.0)
34
+ rspec-core (3.8.2)
35
35
  rspec-support (~> 3.8.0)
36
36
  rspec-expectations (3.8.4)
37
37
  diff-lcs (>= 1.2.0, < 2.0)
@@ -40,7 +40,7 @@ GEM
40
40
  diff-lcs (>= 1.2.0, < 2.0)
41
41
  rspec-support (~> 3.8.0)
42
42
  rspec-support (3.8.2)
43
- rubocop (0.71.0)
43
+ rubocop (0.73.0)
44
44
  jaro_winkler (~> 1.5.1)
45
45
  parallel (~> 1.10)
46
46
  parser (>= 2.6)
@@ -1,6 +1,10 @@
1
1
  module RackGraphql
2
2
  class Application
3
- def self.call(schema:, app_name: 'rack-graphql-service', context_handler: nil, health_route: true)
3
+ def self.call(schema:,
4
+ app_name: 'rack-graphql-service',
5
+ context_handler: nil,
6
+ health_route: true,
7
+ health_response_builder: RackGraphql::HealthResponseBuilder)
4
8
  ::Rack::Builder.new do
5
9
  map '/graphql' do
6
10
  run RackGraphql::Middleware.new(schema: schema, context_handler: context_handler)
@@ -8,11 +12,11 @@ module RackGraphql
8
12
 
9
13
  if health_route
10
14
  map '/health' do
11
- run ->(env) { RackGraphql::HealthResponseBuilder.new(app_name: app_name).build }
15
+ run ->(env) { health_response_builder.new(app_name: app_name, env: env).build }
12
16
  end
13
17
 
14
18
  map '/' do
15
- run ->(env) { RackGraphql::HealthResponseBuilder.new(app_name: app_name).build }
19
+ run ->(env) { health_response_builder.new(app_name: app_name, env: env).build }
16
20
  end
17
21
  end
18
22
  end
@@ -1,7 +1,8 @@
1
1
  module RackGraphql
2
2
  class HealthResponseBuilder
3
- def initialize(app_name:)
3
+ def initialize(app_name:, env: {})
4
4
  @app_name = app_name
5
+ @env = env
5
6
  end
6
7
 
7
8
  def build
@@ -10,7 +11,7 @@ module RackGraphql
10
11
 
11
12
  private
12
13
 
13
- attr_reader :app_name
14
+ attr_reader :app_name, :env
14
15
 
15
16
  def headers
16
17
  { 'Content-Type' => 'application/json' }
@@ -1,3 +1,3 @@
1
1
  module RackGraphql
2
- VERSION = '0.4.0'.freeze
2
+ VERSION = '0.5.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-graphql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Krzysztof Knapik
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2019-06-14 00:00:00.000000000 Z
12
+ date: 2019-07-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: graphql