graphiql-rails 1.4.11 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/graphiql/rails/application.js +3 -3
- data/app/assets/javascripts/graphiql/rails/{graphiql-0.11.11.js → graphiql-0.12.0.js} +7056 -4332
- data/app/assets/javascripts/graphiql/rails/react-16.6.0.js +2976 -0
- data/app/assets/javascripts/graphiql/rails/react-dom-16.6.0.js +19013 -0
- data/app/assets/stylesheets/graphiql/rails/application.css +1 -1
- data/app/assets/stylesheets/graphiql/rails/{graphiql-0.11.11.css → graphiql-0.12.0.css} +29 -3
- data/lib/graphiql/rails/version.rb +1 -1
- metadata +6 -7
- data/app/assets/javascripts/graphiql/rails/react-16.2.0.js +0 -1684
- data/app/assets/javascripts/graphiql/rails/react-dom-16.2.0.js +0 -16068
- data/readme.md +0 -53
data/readme.md
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
# GraphiQL-Rails [![Gem Version](https://badge.fury.io/rb/graphiql-rails.svg)](https://badge.fury.io/rb/graphiql-rails) [![Build Status](https://travis-ci.org/rmosolgo/graphiql-rails.svg)](https://travis-ci.org/rmosolgo/graphiql-rails)
|
2
|
-
|
3
|
-
Mount the [GraphiQL IDE](https://github.com/graphql/graphiql) in Ruby on Rails.
|
4
|
-
|
5
|
-
![image](https://cloud.githubusercontent.com/assets/2231765/12101544/4779ed54-b303-11e5-918e-9f3d3e283170.png)
|
6
|
-
|
7
|
-
## Installation
|
8
|
-
|
9
|
-
Add to your Gemfile:
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
gem "graphiql-rails"
|
13
|
-
```
|
14
|
-
|
15
|
-
## Usage
|
16
|
-
|
17
|
-
### Mount the Engine
|
18
|
-
|
19
|
-
Add the engine to `routes.rb`:
|
20
|
-
|
21
|
-
```ruby
|
22
|
-
# config/routes.rb
|
23
|
-
Rails.application.routes.draw do
|
24
|
-
# ...
|
25
|
-
if Rails.env.development?
|
26
|
-
mount GraphiQL::Rails::Engine, at: "/graphiql", graphql_path: "/your/endpoint"
|
27
|
-
end
|
28
|
-
end
|
29
|
-
```
|
30
|
-
|
31
|
-
- `at:` is the path where GraphiQL will be served. You can access GraphiQL by visiting that path in your app.
|
32
|
-
- `graphql_path:` is the path to the GraphQL endpoint. GraphiQL will send queries to this path.
|
33
|
-
|
34
|
-
### Configuration
|
35
|
-
|
36
|
-
You can override `GraphiQL::Rails.config` values in an initializer (eg, `config/initializers/graphiql.rb`). The configs are:
|
37
|
-
|
38
|
-
- `query_params` (boolean, default `false`): if `true`, the GraphQL query string will be persisted the page's query params
|
39
|
-
- `initial_query` (string, default `nil`): if provided, it will be rendered in the query pane for a visitor's first visit
|
40
|
-
- `title` (string, default `nil`): if provided, it will be rendered in the page <title> tag
|
41
|
-
- `logo` (string, default `nil`): if provided, it will be the text logo
|
42
|
-
- `csrf` (boolean, default `true`): include `X-CSRF-Token` in GraphiQL's HTTP requests
|
43
|
-
- `headers` (hash, `String => Proc`): procs to fetch header values for GraphiQL's HTTP requests, in the form `(view_context) -> { ... }`. For example:
|
44
|
-
|
45
|
-
|
46
|
-
```ruby
|
47
|
-
GraphiQL::Rails.config.headers['Authorization'] = -> (context) { "bearer #{context.cookies['_graphql_token']}" }
|
48
|
-
```
|
49
|
-
|
50
|
-
### Development
|
51
|
-
|
52
|
-
- Tests: `rake test`
|
53
|
-
- Update GraphiQL & dependencies: `rake update_graphiql`
|