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.
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`