ruby_graphiql_explorer 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +11 -8
- data/Gemfile +1 -0
- data/Gemfile.lock +9 -1
- data/README.md +43 -8
- data/lib/ruby_graphiql_explorer/index.html.erb +1 -4
- data/lib/ruby_graphiql_explorer/version.rb +1 -1
- metadata +1 -2
- data/.travis.yml +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f7d2d0e2dd198f6264b5b8a9534f690cf4ee2caf66f6b3979c03396bc3ca06d
|
4
|
+
data.tar.gz: fe304a985c9aca320796bcb8ea23c465e6ff751e5d61e300e2abe8d41fd683c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 394e7b6dae01f1d2b1fbabe8a70f1e36555661e81b5027b6b175106e7c7124385ba4c02fed4e3aa4ee4d69ecc88b5ac984e608a170cbca4d2515444ab209325a
|
7
|
+
data.tar.gz: 33b91a45ba38b298edcc854c3196881de34788b7ff86915eeec9643c4a439b8ff21d477816f5e4a1439ccf641b1c2df99a337fc3f4c1767ed6e6b7de65ffab3e
|
data/.github/workflows/ci.yml
CHANGED
@@ -1,30 +1,33 @@
|
|
1
|
-
name:
|
2
|
-
|
1
|
+
name: Rspec
|
3
2
|
on: [push, pull_request]
|
4
|
-
|
5
3
|
jobs:
|
6
4
|
build:
|
7
5
|
runs-on: ubuntu-latest
|
8
|
-
|
9
6
|
steps:
|
10
7
|
- uses: actions/checkout@v1
|
11
|
-
|
12
8
|
- name: Install Ruby (2.6)
|
13
9
|
uses: actions/setup-ruby@v1
|
14
10
|
with:
|
15
11
|
ruby-version: 2.6.x
|
16
|
-
|
12
|
+
- name: Cache Ruby gems
|
13
|
+
uses: actions/cache@v2
|
14
|
+
with:
|
15
|
+
path: vendor/bundle
|
16
|
+
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
17
|
+
restore-keys: |
|
18
|
+
${{ runner.os }}-gems-
|
17
19
|
- name: Setup Code Climate test-reporter
|
18
20
|
run: |
|
19
21
|
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
20
22
|
chmod +x ./cc-test-reporter
|
21
23
|
./cc-test-reporter before-build
|
22
|
-
- name:
|
24
|
+
- name: Bundle and test with RSpec
|
23
25
|
run: |
|
24
26
|
gem install bundler
|
27
|
+
bundle config path vendor/bundle
|
25
28
|
bundle install --jobs 4 --retry 3
|
26
29
|
bundle exec rspec
|
27
30
|
- name: Publish code coverage
|
28
31
|
run: |
|
29
32
|
export GIT_BRANCH="${GITHUB_REF/refs\/heads\//}"
|
30
|
-
./cc-test-reporter after-build -r ${{secrets.CC_TEST_REPORTER_ID}}
|
33
|
+
./cc-test-reporter after-build -r ${{secrets.CC_TEST_REPORTER_ID}} -t simplecov
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ruby_graphiql_explorer (1.0.
|
4
|
+
ruby_graphiql_explorer (1.0.1)
|
5
5
|
rack-app
|
6
6
|
rack-app-front_end
|
7
7
|
|
@@ -10,6 +10,8 @@ GEM
|
|
10
10
|
specs:
|
11
11
|
ast (2.4.1)
|
12
12
|
diff-lcs (1.4.4)
|
13
|
+
docile (1.3.2)
|
14
|
+
json (2.3.1)
|
13
15
|
parallel (1.19.2)
|
14
16
|
parser (2.7.1.4)
|
15
17
|
ast (~> 2.4.1)
|
@@ -50,6 +52,11 @@ GEM
|
|
50
52
|
rubocop-performance (1.7.1)
|
51
53
|
rubocop (>= 0.82.0)
|
52
54
|
ruby-progressbar (1.10.1)
|
55
|
+
simplecov (0.17.1)
|
56
|
+
docile (~> 1.1)
|
57
|
+
json (>= 1.8, < 3)
|
58
|
+
simplecov-html (~> 0.10.0)
|
59
|
+
simplecov-html (0.10.2)
|
53
60
|
tilt (2.0.10)
|
54
61
|
unicode-display_width (1.7.0)
|
55
62
|
|
@@ -62,6 +69,7 @@ DEPENDENCIES
|
|
62
69
|
rubocop
|
63
70
|
rubocop-performance
|
64
71
|
ruby_graphiql_explorer!
|
72
|
+
simplecov (>= 0.17.1, < 0.18)
|
65
73
|
|
66
74
|
BUNDLED WITH
|
67
75
|
2.1.4
|
data/README.md
CHANGED
@@ -1,15 +1,19 @@
|
|
1
|
-
|
1
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/2b689e2db08845bf3c28/maintainability)](https://codeclimate.com/github/gauravtiwari/ruby_graphiql_explorer/maintainability)
|
2
|
+
[![Test Coverage](https://api.codeclimate.com/v1/badges/2b689e2db08845bf3c28/test_coverage)](https://codeclimate.com/github/gauravtiwari/ruby_graphiql_explorer/test_coverage)
|
3
|
+
![Rspec](https://github.com/gauravtiwari/ruby_graphiql_explorer/workflows/Rspec/badge.svg)
|
2
4
|
|
3
|
-
|
5
|
+
# Ruby Graphiql Explorer
|
4
6
|
|
5
|
-
|
7
|
+
Super simple rack app to render GraphiQL editor into a Ruby or Rails web app.
|
8
|
+
|
9
|
+
![Screenshot](https://user-images.githubusercontent.com/771039/92003081-7f6ca700-ed38-11ea-94af-48c2867d0c29.png)
|
6
10
|
|
7
11
|
## Installation
|
8
12
|
|
9
13
|
Add this line to your application's Gemfile:
|
10
14
|
|
11
15
|
```ruby
|
12
|
-
gem
|
16
|
+
gem "ruby_graphiql_explorer"
|
13
17
|
```
|
14
18
|
|
15
19
|
And then execute:
|
@@ -22,15 +26,46 @@ Or install it yourself as:
|
|
22
26
|
|
23
27
|
## Usage
|
24
28
|
|
25
|
-
|
29
|
+
### Rails
|
30
|
+
|
31
|
+
Mount the rack app in `routes.rb`
|
32
|
+
|
33
|
+
```rb
|
34
|
+
mount RubyGraphiqlExplorer::App, at: "/graphiql"
|
35
|
+
```
|
36
|
+
|
37
|
+
### Ruby
|
38
|
+
|
39
|
+
Using `config.ru`
|
40
|
+
|
41
|
+
```rb
|
42
|
+
require "ruby_graphiql_explorer"
|
43
|
+
run RubyGraphiqlExplorer::App
|
44
|
+
```
|
45
|
+
|
46
|
+
Using `Rack::URLMap`
|
47
|
+
|
48
|
+
```rb
|
49
|
+
require "ruby_graphiql_explorer"
|
50
|
+
run Rack::URLMap.new("/graphiql" => RubyGraphiqlExplorer::App)
|
51
|
+
```
|
52
|
+
|
53
|
+
By default the rack app expects GraphQL endpoint to be available at
|
54
|
+
`http://localhost::3000/graphql` but you can override using
|
55
|
+
`GRAPHQL_API_URL` env variable. Additionally, you can set api key/token using
|
56
|
+
`GRAPHQL_API_KEY` if your GraphQL API is protected.
|
57
|
+
|
58
|
+
```yml
|
59
|
+
GRAPHQL_API_URL: http://localhost::3000/api
|
60
|
+
GRAPHQL_API_KEY: foobar
|
61
|
+
```
|
26
62
|
|
27
63
|
## Development
|
28
64
|
|
29
|
-
After checking out the repo, run `
|
65
|
+
After checking out the repo, run `bundle` to install dependencies. Then, run `bundle exec rspec spec` to run the tests.
|
30
66
|
|
31
67
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
68
|
|
33
69
|
## Contributing
|
34
70
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
36
|
-
|
71
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/gauravtiwari/ruby_graphiql_explorer.
|
@@ -25,10 +25,7 @@
|
|
25
25
|
method: 'post',
|
26
26
|
headers: {
|
27
27
|
'Content-Type': 'application/json',
|
28
|
-
Authorization: '<%= ENV.fetch(
|
29
|
-
'GRAPHQL_API_KEY',
|
30
|
-
'http://localhost:3000/graphql'
|
31
|
-
) %>'
|
28
|
+
Authorization: '<%= ENV.fetch('GRAPHQL_API_KEY', '') %>'
|
32
29
|
},
|
33
30
|
body: JSON.stringify(graphQLParams)
|
34
31
|
})
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_graphiql_explorer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gaurav Tiwari
|
@@ -77,7 +77,6 @@ files:
|
|
77
77
|
- ".gitignore"
|
78
78
|
- ".rspec"
|
79
79
|
- ".rubocop.yml"
|
80
|
-
- ".travis.yml"
|
81
80
|
- Gemfile
|
82
81
|
- Gemfile.lock
|
83
82
|
- LICENSE
|