rack-graphql 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +5 -5
- data/lib/rack_graphql/application.rb +7 -3
- data/lib/rack_graphql/health_response_builder.rb +3 -2
- data/lib/rack_graphql/version.rb +1 -1
- 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: 35f7fbe9c74f115820b227518de4ff12f0de6f91165915cbd8e6bb94bd84fe7b
|
4
|
+
data.tar.gz: eff9b16ee494fd6eca62d2bcf3153211e9751265ed41cba758f3ce99a3077976
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
+
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.
|
16
|
-
jaro_winkler (1.5.
|
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.
|
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.
|
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:,
|
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) {
|
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) {
|
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' }
|
data/lib/rack_graphql/version.rb
CHANGED
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
|
+
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-
|
12
|
+
date: 2019-07-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: graphql
|