apollo-tracing 1.1.0 → 1.2.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
  SHA1:
3
- metadata.gz: 5427c1c7ad4c390d7ea73e5089b4291cbb6012c6
4
- data.tar.gz: 06cb235d0c59d3e0fae40e7ac7b1a09b2deb4709
3
+ metadata.gz: 4a960c73048ee514c57f79eea687b29deb99f2ba
4
+ data.tar.gz: 2527d9e1d18f34b2c4ad5933ba6e1481e266a27a
5
5
  SHA512:
6
- metadata.gz: 8a69276f3105a1e7deff72b05e5adad500848a3160118672fb3708016a591eacea074c23b73cf8150a7781c4e501980d42ba2d5ef7dafc712463d8d9515a5fdb
7
- data.tar.gz: f9b06d4e3d7b14a56f96a01c48640ec92f04a9042c1ebb5254a8781117f98280f5816c79ea3c8826b8748a626590deed35c2dfdbff85780c3a7a53a2e7628f64
6
+ metadata.gz: 73b4eb90dd6fadf694bfd2297f060b8b05ce271693f151e604f4002bf3048b4e65ca8c337d02db0e40c2daa1dccebfce0c1d61095665a2f9ee5a8c3945f12bdb
7
+ data.tar.gz: 007f850db2181defd143a79ebcb0d7eb7dcdbeafb483f6293a941576f13ccd72272ca307af42b55377d704037686772461ca8aec753da9ea4bae3306114ac6d1
data/CHANGELOG.md CHANGED
@@ -8,13 +8,17 @@ one of the following labels: `Added`, `Changed`, `Deprecated`,
8
8
  to manage the versions of this gem so
9
9
  that you can set version constraints properly.
10
10
 
11
- #### [Unreleased](https://github.com/uniiverse/apollo-tracing-ruby/compare/v1.1.0...HEAD)
11
+ #### [Unreleased](https://github.com/uniiverse/apollo-tracing-ruby/compare/v1.2.0...HEAD)
12
12
 
13
13
  * WIP
14
14
 
15
- #### [v1.1.0](https://github.com/uniiverse/apollo-tracing-ruby/compare/v1.0.0..v1.1.0) – 2017-10-25
15
+ #### [v1.2.0](https://github.com/uniiverse/apollo-tracing-ruby/compare/v1.1.0...v1.2.0) – 2017-10-26
16
16
 
17
- * `Added`: Apollo Engine Proxy version [2017.10-408-g497e1410](https://www.apollographql.com/docs/engine/proxy-release-notes.html). ([#2](https://github.com/uniiverse/apollo-tracing-ruby/pull/2))
17
+ * `Added`: `ApolloTracing.start_proxy` accepts a JSON string. [#3](https://github.com/uniiverse/apollo-tracing-ruby/pull/3)
18
+
19
+ #### [v1.1.0](https://github.com/uniiverse/apollo-tracing-ruby/compare/v1.0.0...v1.1.0) – 2017-10-25
20
+
21
+ * `Added`: Apollo Engine Proxy version [2017.10-408-g497e1410](https://www.apollographql.com/docs/engine/proxy-release-notes.html). [#2](https://github.com/uniiverse/apollo-tracing-ruby/pull/2)
18
22
 
19
23
  #### [v1.0.0](https://github.com/uniiverse/apollo-tracing-ruby/compare/v0.1.1...v1.0.0) – 2017-10-17
20
24
 
data/README.md CHANGED
@@ -167,7 +167,7 @@ Here is the general architecture overview of a sidecar mode – Proxy runs next
167
167
  ----------------- response ----------------- response -----------------
168
168
  |
169
169
  |
170
- GraphQL tracing data |
170
+ GraphQL tracing | from response
171
171
  |
172
172
  ˅
173
173
  -----------------
@@ -190,7 +190,7 @@ To configure the Proxy create a Proxy config file:
190
190
  "http": { "url": "http://localhost:3000/graphql" }
191
191
  }],
192
192
  "frontends": [{
193
- "host": "127.0.0.1", "port": 3001, "endpoint": "/graphql"
193
+ "host": "localhost", "port": 3001, "endpoint": "/graphql"
194
194
  }]
195
195
  }
196
196
  ```
@@ -203,7 +203,7 @@ To configure the Proxy create a Proxy config file:
203
203
  To run the Proxy as a child process, which will be automatically terminated if the Application proccess stoped, add the following line to the `config.ru` file:
204
204
 
205
205
  <pre>
206
- # config.ru – this file is used by Rack-based servers to start the application.
206
+ # config.ru – this file is used by Rack-based servers to start the application
207
207
  require File.expand_path('../config/environment', __FILE__)
208
208
 
209
209
  <b>ApolloTracing.start_proxy('config/apollo-engine-proxy.json')</b>
@@ -213,7 +213,7 @@ run Your::Application
213
213
  For example, if you use [rails](https://github.com/rails/rails) with [puma](https://github.com/puma/puma) application server and run it like:
214
214
 
215
215
  ```
216
- bundle exec puma -w 2 -t 16 -p 3001
216
+ bundle exec puma -w 2 -t 16 -p 3000
217
217
  ```
218
218
 
219
219
  The proccess tree may look like:
@@ -4,8 +4,13 @@ require "graphql"
4
4
  require "apollo_tracing/version"
5
5
 
6
6
  class ApolloTracing
7
- def self.start_proxy(config_filepath = 'config/apollo-engine.json')
8
- config_json = File.read(config_filepath)
7
+ def self.start_proxy(config_filepath_or_json = 'config/apollo-engine.json')
8
+ config_json =
9
+ if File.exist?(config_filepath_or_json)
10
+ File.read(config_filepath_or_json)
11
+ else
12
+ config_filepath_or_json
13
+ end
9
14
  binary_path =
10
15
  if RUBY_PLATFORM.include?('darwin')
11
16
  File.expand_path('../../bin/engineproxy_darwin_amd64', __FILE__)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class ApolloTracing
4
- VERSION = "1.1.0"
4
+ VERSION = "1.2.0"
5
5
  end
@@ -11,6 +11,13 @@ RSpec.describe ApolloTracing do
11
11
  expect { Process.getpgid(pid) }.not_to raise_error
12
12
  ApolloTracing.stop_proxy
13
13
  end
14
+
15
+ it 'runs a proxy with a given JSON instead of a file path' do
16
+ config_json = File.read('spec/fixtures/apollo-engine-proxy.json')
17
+ pid = ApolloTracing.start_proxy(config_json)
18
+ expect { Process.getpgid(pid) }.not_to raise_error
19
+ ApolloTracing.stop_proxy
20
+ end
14
21
  end
15
22
 
16
23
  describe '.stop_proxy' do
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "apiKey": "service:YOUR_ENGINE_API_KEY",
3
- "logging": { "level": "DEBUG" },
3
+ "logging": { "level": "INFO" },
4
4
  "origins": [{
5
5
  "http": { "url": "http://localhost:3000/graphql" }
6
6
  }],
7
7
  "frontends": [{
8
- "host": "127.0.0.1", "port": 3001, "endpoint": "/graphql"
8
+ "host": "localhost", "port": 3001, "endpoint": "/graphql"
9
9
  }]
10
10
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apollo-tracing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Reginald Suh
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2017-10-25 00:00:00.000000000 Z
12
+ date: 2017-10-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: graphql