graphiql-rails 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/graphiql/rails/application.js +3 -3
  3. data/app/assets/javascripts/graphiql/rails/{graphiql-0.7.0.js → graphiql-0.7.4.js} +19451 -18140
  4. data/app/assets/javascripts/graphiql/rails/{react-15.0.1.js → react-15.3.1.js} +4064 -2806
  5. data/app/assets/javascripts/graphiql/rails/{react-dom-15.0.1.js → react-dom-15.3.1.js} +1 -1
  6. data/app/assets/stylesheets/graphiql/rails/application.css +1 -1
  7. data/app/assets/stylesheets/graphiql/rails/{graphiql-0.7.0.css → graphiql-0.7.4.css} +0 -0
  8. data/app/views/graphiql/rails/editors/show.html.erb +5 -8
  9. data/lib/graphiql/rails.rb +2 -7
  10. data/lib/graphiql/rails/config.rb +41 -0
  11. data/lib/graphiql/rails/version.rb +1 -1
  12. data/readme.md +10 -7
  13. data/test/controllers/editors_controller_test.rb +13 -5
  14. data/test/dummy/log/test.log +387 -0
  15. data/test/dummy/tmp/cache/assets/sprockets/v3.0/02/02uQjjynUxV5kuoUaBVFB5IWapuQczQFPUf3bYiA9Y0.cache +1 -0
  16. data/test/dummy/tmp/cache/assets/sprockets/v3.0/0C/0CmYIsbxi_d3V4Ty50KFvUlvEWI9jcWyJF0t9cCLpyM.cache +1 -0
  17. data/test/dummy/tmp/cache/assets/sprockets/v3.0/1O/1O4GprDp8WJyw5PvSa-C2r44Jd9TcTN3-QtJng226qo.cache +0 -0
  18. data/test/dummy/tmp/cache/assets/sprockets/v3.0/1u/1uC5QtXp4WO7tAZao3L7BG2PEcNqq1_r0puQ3-HIcYI.cache +1 -0
  19. data/test/dummy/tmp/cache/assets/sprockets/v3.0/1w/1wZlmSdNjHZpUpkPMpH9S5OQVTCCqlexBJSLdPPeR50.cache +1 -0
  20. data/test/dummy/tmp/cache/assets/sprockets/v3.0/34/34LG8q9JejZ6KDvdkHQ8JUB-nOQwlA2fHTilXzwS5GY.cache +1 -0
  21. data/test/dummy/tmp/cache/assets/sprockets/v3.0/4Z/4ZJA85qP4_8GsXx80nM0iXDJplSrE8la7PtHGTorD0w.cache +1 -0
  22. data/test/dummy/tmp/cache/assets/sprockets/v3.0/4m/4mtjpwCX3vwIxOYpNuyjilCrhtrkgWVNBGJS21tzfL0.cache +0 -0
  23. data/test/dummy/tmp/cache/assets/sprockets/v3.0/7j/7jpsqSrz9yb3YIyo7b2pHa6czpq8WFE0AnAengWbZpM.cache +3 -0
  24. data/test/dummy/tmp/cache/assets/sprockets/v3.0/7l/7lWekuUK_gHC4C-i267KGydIQehipyEoShk4i5Lu_BM.cache +0 -0
  25. data/test/dummy/tmp/cache/assets/sprockets/v3.0/9M/9MuQHTmDOg0b9oWEK4GI1o5PUXLgIpjIPa10mC6RdaQ.cache +1 -0
  26. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Be/BenmbG7rfjNHpucEMFB8yUS9EYgeA1DSpiNlTqkquaQ.cache +1 -0
  27. data/test/dummy/tmp/cache/assets/sprockets/v3.0/CZ/CZxQnnrZMMsvjfD4KW4DhgTG94EVxnHoJWJ01zkVMns.cache +1 -0
  28. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Fa/Faq8gOm8xVZhblw9FwQ1E4IsfWoh9dZ1gBHmFvLc2ts.cache +1 -0
  29. data/test/dummy/tmp/cache/assets/sprockets/v3.0/HP/HPftDTK68u7AeXS-WC5itXmNNt6wi668JeiLs5PUeMs.cache +3 -0
  30. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ID/IDcWzb4XA1vue9ua86ZYwdBPBid71jBsuD9HBlnycuE.cache +3 -0
  31. data/test/dummy/tmp/cache/assets/sprockets/v3.0/OF/OF4cuA4wXYuETOyoWH3LmWrULXXLj-Og0hlZKcwMh_c.cache +3 -0
  32. data/test/dummy/tmp/cache/assets/sprockets/v3.0/VT/VTELxahRZ8MKZdJdMyrzzXnjIEsa4tYlG_KKqxD2w5E.cache +2 -0
  33. data/test/dummy/tmp/cache/assets/sprockets/v3.0/XV/XVXfWH7Tr4k5jKKRYXmthP7AR2GJJKDr-AWNHUH5nts.cache +0 -0
  34. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Xq/Xq4246oV8V3LGAV_PXeBgShRCE_g-JfGen06X1D_qo4.cache +1 -0
  35. data/test/dummy/tmp/cache/assets/sprockets/v3.0/YZ/YZ76qRpXORD7l_H2nsleL_V4wM1KMRxCrgSrAKlSJhA.cache +0 -0
  36. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ar/ar_4xG5VXmCcjrfvlw32CcUrEy7Q-OeTTgfgptLOdU8.cache +1 -0
  37. data/test/dummy/tmp/cache/assets/sprockets/v3.0/bS/bSZX9zl8edN-dveNd84MIogYeQCV9AuYhYgWy6ea1B4.cache +0 -0
  38. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ga/gava0bqDjE1VWzplpUduR1uGHbtyUtYm2GhIj1XZZX0.cache +2 -0
  39. data/test/dummy/tmp/cache/assets/sprockets/v3.0/hQ/hQiz6pgkjKTcBzpg6HxImHPEn_gJnNexHa93Uqf06C4.cache +1 -0
  40. data/test/dummy/tmp/cache/assets/sprockets/v3.0/jN/jN_nBtWnLYTrl91F5CMO0jRb1croRzJFAOifWmwdv5c.cache +0 -0
  41. data/test/dummy/tmp/cache/assets/sprockets/v3.0/kS/kSbsfLp-s-6NEu4COSZH4WgeVd8foAqxOubPR-6svPs.cache +1 -0
  42. data/test/dummy/tmp/cache/assets/sprockets/v3.0/l8/l8f5_J8x7RojLRvBjQI_CftB1yepgAXvpmYK4lcMZ7s.cache +0 -0
  43. data/test/dummy/tmp/cache/assets/sprockets/v3.0/lh/lhC_YGvH38iYVTa-Ed5Amry182T8GMgA_5taQuLjdyY.cache +0 -0
  44. data/test/dummy/tmp/cache/assets/sprockets/v3.0/lo/loBrkqZ9oaNCN6tAXz6GMUBqeOWA-e1JarXdJ-SDb_U.cache +2 -0
  45. data/test/dummy/tmp/cache/assets/sprockets/v3.0/qc/qcZ4CJuZSIdaNsulaHHmp1FgTQ4OpDXKDC0fhGwUeqQ.cache +1 -0
  46. data/test/dummy/tmp/cache/assets/sprockets/v3.0/rb/rbdNJgw4y-kvQ88qyU3nXHn7ZKc4BVVcfDKOQa_gVCk.cache +2 -0
  47. data/test/dummy/tmp/cache/assets/sprockets/v3.0/sj/sjMLajFJTU99ayb93IyjMjJR14wApGOeV0oBXIezq8U.cache +1 -0
  48. data/test/dummy/tmp/cache/assets/sprockets/v3.0/v8/v8xi6V-WvjufXeLCNBFSbt1d-olho3MyMBbKM-Vnwu8.cache +0 -0
  49. data/test/dummy/tmp/cache/assets/sprockets/v3.0/yL/yLVqhPCNcVTbpUt7K66-E4rXgH9sPDxfNXqMWF_eM44.cache +3 -0
  50. data/test/dummy/tmp/cache/assets/sprockets/v3.0/zM/zMMCZgiw01jo_FiNbm2w3OeIQRjv8JTb3dVaa0lOifs.cache +0 -0
  51. data/test/graphiql/rails/config_test.rb +24 -0
  52. metadata +81 -7
  53. data/lib/graphiql/rails/welcome_message.rb +0 -19
@@ -1,5 +1,5 @@
1
1
  /**
2
- * ReactDOM v15.0.1
2
+ * ReactDOM v15.3.1
3
3
  *
4
4
  * Copyright 2013-present, Facebook, Inc.
5
5
  * All rights reserved.
@@ -1,5 +1,5 @@
1
1
  /*
2
- = require ./graphiql-0.7.0
2
+ = require ./graphiql-0.7.4
3
3
  */
4
4
 
5
5
  html, body {
@@ -4,9 +4,6 @@
4
4
  <title>GraphiQL</title>
5
5
  <%= stylesheet_link_tag("graphiql/rails/application") %>
6
6
  <%= javascript_include_tag("graphiql/rails/application") %>
7
- <% if GraphiQL::Rails.config.csrf %>
8
- <%= csrf_meta_tags %>
9
- <% end %>
10
7
  </head>
11
8
  <body>
12
9
  <div id="graphiql-container">
@@ -59,11 +56,7 @@
59
56
  function graphQLFetcher(graphQLParams) {
60
57
  return fetch(graphQLEndpoint, {
61
58
  method: 'post',
62
- headers: { 'Content-Type': 'application/json',
63
- <% if GraphiQL::Rails.config.csrf %>
64
- 'X-CSRF-Token': document.getElementsByName("csrf-token")[0].content
65
- <% end %>
66
- },
59
+ headers: <%= raw JSON.pretty_generate(GraphiQL::Rails.config.resolve_headers(self)) %>,
67
60
  body: JSON.stringify(graphQLParams),
68
61
  credentials: 'include',
69
62
  }).then(function (response) {
@@ -71,7 +64,11 @@
71
64
  });
72
65
  }
73
66
 
67
+ <% if GraphiQL::Rails.config.initial_query %>
74
68
  var defaultQuery = "<%= GraphiQL::Rails.config.initial_query.gsub(/\n/, "\\n") %>";
69
+ <% else %>
70
+ var defaultQuery = undefined
71
+ <% end %>
75
72
 
76
73
  // Render <GraphiQL /> into the body.
77
74
  ReactDOM.render(
@@ -11,10 +11,9 @@ else
11
11
  end
12
12
  end
13
13
 
14
+ require "graphiql/rails/config"
14
15
  require "graphiql/rails/engine"
15
16
  require "graphiql/rails/version"
16
- require "graphiql/rails/welcome_message"
17
-
18
17
 
19
18
  module GraphiQL
20
19
  module Rails
@@ -22,10 +21,6 @@ module GraphiQL
22
21
  attr_accessor :config
23
22
  end
24
23
 
25
- self.config = OpenStruct.new({
26
- query_params: false,
27
- initial_query: GraphiQL::Rails::WELCOME_MESSAGE,
28
- csrf: false
29
- })
24
+ self.config = Config.new
30
25
  end
31
26
  end
@@ -0,0 +1,41 @@
1
+ module GraphiQL
2
+ module Rails
3
+ class Config
4
+ # @example Adding a header to the request
5
+ # config.headers["My-Header"] = -> (view_context) { "My-Value" }
6
+ #
7
+ # @return [Hash<String => Proc>] Keys are headers to include in GraphQL requests, values are `->(view_context) { ... }` procs to determin values
8
+ attr_accessor :headers
9
+
10
+ attr_accessor :query_params, :initial_query, :csrf
11
+
12
+ DEFAULT_HEADERS = {
13
+ 'Content-Type' => ->(_) { 'application/json' },
14
+ }
15
+
16
+ CSRF_TOKEN_HEADER = {
17
+ "X-CSRF-Token" => -> (view_context) { view_context.form_authenticity_token }
18
+ }
19
+
20
+ def initialize(query_params: false, initial_query: nil, csrf: true, headers: DEFAULT_HEADERS)
21
+ @query_params = query_params
22
+ @headers = headers.dup
23
+ @initial_query = initial_query
24
+ @csrf = csrf
25
+ end
26
+
27
+ # Call defined procs, add CSRF token if specified
28
+ def resolve_headers(view_context)
29
+ all_headers = DEFAULT_HEADERS.merge(headers)
30
+
31
+ if csrf
32
+ all_headers = all_headers.merge(CSRF_TOKEN_HEADER)
33
+ end
34
+
35
+ all_headers.each_with_object({}) do |(key, value), memo|
36
+ memo[key] = value.call(view_context)
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -1,5 +1,5 @@
1
1
  module GraphiQL
2
2
  module Rails
3
- VERSION = "1.2.0"
3
+ VERSION = "1.3.0"
4
4
  end
5
5
  end
data/readme.md CHANGED
@@ -33,14 +33,17 @@ end
33
33
 
34
34
  ### Configuration
35
35
 
36
- You can override `GraphiQL::Rails` configs in an initializer (eg, `config/initializers/graphiql.rb`). The configs are:
36
+ You can override `GraphiQL::Rails.config` values in an initializer (eg, `config/initializers/graphiql.rb`). The configs are:
37
37
 
38
- ```ruby
39
- # These are the default values:
40
- GraphiQL::Rails.config.query_params = false # if true, the GraphQL query string will be persisted the page's query params.
41
- GraphiQL::Rails.config.initial_query = GraphiQL::Rails::WELCOME_MESSAGE # This string is presented to a new user
42
- GraphiQL::Rails.config.csrf = false # if true, CSRF token will added and sent along with POST request to the GraphQL endpoint
43
- ```
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
+ - `csrf` (boolean, default `true`): include `X-CSRF-Token` in GraphiQL's HTTP requests
41
+ - `headers` (hash, `String => Proc`): procs to fetch header values for GraphiQL's HTTP requests, in the form `(view_context) -> { ... }`. For example:
42
+
43
+
44
+ ```ruby
45
+ GraphiQL::Rails.config.headers['Authorization'] = -> (context) { "bearer #{context.cookies['_graphql_token']}" }
46
+ ```
44
47
 
45
48
  ### Development
46
49
 
@@ -9,7 +9,8 @@ module GraphiQL
9
9
 
10
10
  teardown do
11
11
  GraphiQL::Rails.config.query_params = false
12
- GraphiQL::Rails.config.initial_query = GraphiQL::Rails::WELCOME_MESSAGE
12
+ GraphiQL::Rails.config.initial_query = nil
13
+ GraphiQL::Rails.config.headers = {}
13
14
  end
14
15
 
15
16
  test "renders GraphiQL" do
@@ -21,13 +22,13 @@ module GraphiQL
21
22
  end
22
23
 
23
24
  test "it uses initial_query config" do
24
- get :show, graphql_path: "/my/endpoint"
25
- assert_includes(@response.body, "Welcome to GraphiQL")
26
-
27
25
  GraphiQL::Rails.config.initial_query = "{ customQuery }"
28
26
  get :show, graphql_path: "/my/endpoint"
29
- refute_includes(@response.body, "Welcome to GraphiQL")
30
27
  assert_includes(@response.body, "{ customQuery }")
28
+
29
+ GraphiQL::Rails.config.initial_query = nil
30
+ get :show, graphql_path: "/my/endpoint"
31
+ refute_includes(@response.body, "{ customQuery }")
31
32
  end
32
33
 
33
34
  test "it uses query_params config" do
@@ -38,6 +39,13 @@ module GraphiQL
38
39
  get :show, graphql_path: "/my/endpoint"
39
40
  assert_includes(@response.body, "onEditQuery")
40
41
  end
42
+
43
+ test "it renders headers" do
44
+ GraphiQL::Rails.config.headers["Nonsense-Header"] = -> (view_ctx) { "Value" }
45
+ get :show, graphql_path: "/my/endpoint"
46
+ assert_includes(@response.body, %|"Nonsense-Header": "Value"|)
47
+ assert_includes(@response.body, %|"X-CSRF-Token": "|)
48
+ end
41
49
  end
42
50
  end
43
51
  end
@@ -323,3 +323,390 @@ Completed 200 OK in 1ms (Views: 0.9ms)
323
323
  --------------------------------------------
324
324
  GraphiQL::RailsTest: test_configs_can_be_set
325
325
  --------------------------------------------
326
+ -------------------------------------------------
327
+ ConfigTest: test_it_adds_CSRF_header_if_requested
328
+ -------------------------------------------------
329
+ -----------------------------------------------
330
+ ConfigTest: test_it_adds_JSON_header_by_default
331
+ -----------------------------------------------
332
+ --------------------------------------------
333
+ GraphiQL::RailsTest: test_configs_can_be_set
334
+ --------------------------------------------
335
+ ------------------------------
336
+ EngineTest: test_it_is_defined
337
+ ------------------------------
338
+ -------------------------------------------------------------
339
+ GraphiQL::Rails::EditorsControllerTest: test_renders_GraphiQL
340
+ -------------------------------------------------------------
341
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
342
+ Parameters: {"graphql_path"=>"/my/endpoint"}
343
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (549.4ms)
344
+ Completed 500 Internal Server Error in 557ms
345
+ -------------------------------------------------------------------------
346
+ GraphiQL::Rails::EditorsControllerTest: test_it_uses_initial_query_config
347
+ -------------------------------------------------------------------------
348
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
349
+ Parameters: {"graphql_path"=>"/my/endpoint"}
350
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (4.0ms)
351
+ Completed 500 Internal Server Error in 5ms
352
+ ------------------------------------------------------------------------
353
+ GraphiQL::Rails::EditorsControllerTest: test_it_uses_query_params_config
354
+ ------------------------------------------------------------------------
355
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
356
+ Parameters: {"graphql_path"=>"/my/endpoint"}
357
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (3.3ms)
358
+ Completed 500 Internal Server Error in 4ms
359
+ -------------------------------------------------------------------------
360
+ GraphiQL::Rails::EditorsControllerTest: test_it_uses_initial_query_config
361
+ -------------------------------------------------------------------------
362
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
363
+ Parameters: {"graphql_path"=>"/my/endpoint"}
364
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (137.3ms)
365
+ Completed 500 Internal Server Error in 144ms
366
+ ------------------------------------------------------------------------
367
+ GraphiQL::Rails::EditorsControllerTest: test_it_uses_query_params_config
368
+ ------------------------------------------------------------------------
369
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
370
+ Parameters: {"graphql_path"=>"/my/endpoint"}
371
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (5.6ms)
372
+ Completed 500 Internal Server Error in 6ms
373
+ -------------------------------------------------------------
374
+ GraphiQL::Rails::EditorsControllerTest: test_renders_GraphiQL
375
+ -------------------------------------------------------------
376
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
377
+ Parameters: {"graphql_path"=>"/my/endpoint"}
378
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (3.1ms)
379
+ Completed 500 Internal Server Error in 3ms
380
+ ------------------------------
381
+ EngineTest: test_it_is_defined
382
+ ------------------------------
383
+ -------------------------------------------------
384
+ ConfigTest: test_it_adds_CSRF_header_if_requested
385
+ -------------------------------------------------
386
+ -----------------------------------------------
387
+ ConfigTest: test_it_adds_JSON_header_by_default
388
+ -----------------------------------------------
389
+ --------------------------------------------
390
+ GraphiQL::RailsTest: test_configs_can_be_set
391
+ --------------------------------------------
392
+ --------------------------------------------
393
+ GraphiQL::RailsTest: test_configs_can_be_set
394
+ --------------------------------------------
395
+ ------------------------------------------------------------------------
396
+ GraphiQL::Rails::EditorsControllerTest: test_it_uses_query_params_config
397
+ ------------------------------------------------------------------------
398
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
399
+ Parameters: {"graphql_path"=>"/my/endpoint"}
400
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (192.0ms)
401
+ Completed 500 Internal Server Error in 199ms
402
+ -------------------------------------------------------------
403
+ GraphiQL::Rails::EditorsControllerTest: test_renders_GraphiQL
404
+ -------------------------------------------------------------
405
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
406
+ Parameters: {"graphql_path"=>"/my/endpoint"}
407
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (6.5ms)
408
+ Completed 500 Internal Server Error in 7ms
409
+ -------------------------------------------------------------------------
410
+ GraphiQL::Rails::EditorsControllerTest: test_it_uses_initial_query_config
411
+ -------------------------------------------------------------------------
412
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
413
+ Parameters: {"graphql_path"=>"/my/endpoint"}
414
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (4.2ms)
415
+ Completed 500 Internal Server Error in 5ms
416
+ -------------------------------------------------
417
+ ConfigTest: test_it_adds_CSRF_header_if_requested
418
+ -------------------------------------------------
419
+ -----------------------------------------------
420
+ ConfigTest: test_it_adds_JSON_header_by_default
421
+ -----------------------------------------------
422
+ ------------------------------
423
+ EngineTest: test_it_is_defined
424
+ ------------------------------
425
+ ------------------------------------------------------------------------
426
+ GraphiQL::Rails::EditorsControllerTest: test_it_uses_query_params_config
427
+ ------------------------------------------------------------------------
428
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
429
+ Parameters: {"graphql_path"=>"/my/endpoint"}
430
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (152.3ms)
431
+ Completed 500 Internal Server Error in 165ms
432
+ -------------------------------------------------------------------------
433
+ GraphiQL::Rails::EditorsControllerTest: test_it_uses_initial_query_config
434
+ -------------------------------------------------------------------------
435
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
436
+ Parameters: {"graphql_path"=>"/my/endpoint"}
437
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (5.3ms)
438
+ Completed 500 Internal Server Error in 6ms
439
+ -------------------------------------------------------------
440
+ GraphiQL::Rails::EditorsControllerTest: test_renders_GraphiQL
441
+ -------------------------------------------------------------
442
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
443
+ Parameters: {"graphql_path"=>"/my/endpoint"}
444
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (3.0ms)
445
+ Completed 500 Internal Server Error in 3ms
446
+ ------------------------------
447
+ EngineTest: test_it_is_defined
448
+ ------------------------------
449
+ --------------------------------------------
450
+ GraphiQL::RailsTest: test_configs_can_be_set
451
+ --------------------------------------------
452
+ -------------------------------------------------
453
+ ConfigTest: test_it_adds_CSRF_header_if_requested
454
+ -------------------------------------------------
455
+ -----------------------------------------------
456
+ ConfigTest: test_it_adds_JSON_header_by_default
457
+ -----------------------------------------------
458
+ -------------------------------------------------
459
+ ConfigTest: test_it_adds_CSRF_header_if_requested
460
+ -------------------------------------------------
461
+ -----------------------------------------------
462
+ ConfigTest: test_it_adds_JSON_header_by_default
463
+ -----------------------------------------------
464
+ -------------------------------------------------------------------------
465
+ GraphiQL::Rails::EditorsControllerTest: test_it_uses_initial_query_config
466
+ -------------------------------------------------------------------------
467
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
468
+ Parameters: {"graphql_path"=>"/my/endpoint"}
469
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (149.4ms)
470
+ Completed 500 Internal Server Error in 156ms
471
+ ------------------------------------------------------------------------
472
+ GraphiQL::Rails::EditorsControllerTest: test_it_uses_query_params_config
473
+ ------------------------------------------------------------------------
474
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
475
+ Parameters: {"graphql_path"=>"/my/endpoint"}
476
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (6.7ms)
477
+ Completed 500 Internal Server Error in 7ms
478
+ -------------------------------------------------------------
479
+ GraphiQL::Rails::EditorsControllerTest: test_renders_GraphiQL
480
+ -------------------------------------------------------------
481
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
482
+ Parameters: {"graphql_path"=>"/my/endpoint"}
483
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (3.1ms)
484
+ Completed 500 Internal Server Error in 3ms
485
+ ------------------------------
486
+ EngineTest: test_it_is_defined
487
+ ------------------------------
488
+ --------------------------------------------
489
+ GraphiQL::RailsTest: test_configs_can_be_set
490
+ --------------------------------------------
491
+ -------------------------------------------------
492
+ ConfigTest: test_it_adds_CSRF_header_if_requested
493
+ -------------------------------------------------
494
+ -----------------------------------------------
495
+ ConfigTest: test_it_adds_JSON_header_by_default
496
+ -----------------------------------------------
497
+ ------------------------------------------------------------------------
498
+ GraphiQL::Rails::EditorsControllerTest: test_it_uses_query_params_config
499
+ ------------------------------------------------------------------------
500
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
501
+ Parameters: {"graphql_path"=>"/my/endpoint"}
502
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (139.8ms)
503
+ Completed 200 OK in 146ms (Views: 146.3ms)
504
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
505
+ Parameters: {"graphql_path"=>"/my/endpoint"}
506
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (0.7ms)
507
+ Completed 200 OK in 1ms (Views: 1.0ms)
508
+ -------------------------------------------------------------
509
+ GraphiQL::Rails::EditorsControllerTest: test_renders_GraphiQL
510
+ -------------------------------------------------------------
511
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
512
+ Parameters: {"graphql_path"=>"/my/endpoint"}
513
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (0.7ms)
514
+ Completed 200 OK in 1ms (Views: 1.0ms)
515
+ -------------------------------------------------------------------------
516
+ GraphiQL::Rails::EditorsControllerTest: test_it_uses_initial_query_config
517
+ -------------------------------------------------------------------------
518
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
519
+ Parameters: {"graphql_path"=>"/my/endpoint"}
520
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (0.9ms)
521
+ Completed 200 OK in 1ms (Views: 1.3ms)
522
+ --------------------------------------------
523
+ GraphiQL::RailsTest: test_configs_can_be_set
524
+ --------------------------------------------
525
+ ------------------------------
526
+ EngineTest: test_it_is_defined
527
+ ------------------------------
528
+ ------------------------------
529
+ EngineTest: test_it_is_defined
530
+ ------------------------------
531
+ -------------------------------------------------------------
532
+ GraphiQL::Rails::EditorsControllerTest: test_renders_GraphiQL
533
+ -------------------------------------------------------------
534
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
535
+ Parameters: {"graphql_path"=>"/my/endpoint"}
536
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (130.7ms)
537
+ Completed 200 OK in 138ms (Views: 137.9ms)
538
+ -------------------------------------------------------------------------
539
+ GraphiQL::Rails::EditorsControllerTest: test_it_uses_initial_query_config
540
+ -------------------------------------------------------------------------
541
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
542
+ Parameters: {"graphql_path"=>"/my/endpoint"}
543
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (0.7ms)
544
+ Completed 200 OK in 1ms (Views: 1.0ms)
545
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
546
+ Parameters: {"graphql_path"=>"/my/endpoint"}
547
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (0.5ms)
548
+ Completed 200 OK in 1ms (Views: 0.7ms)
549
+ ------------------------------------------------------------------------
550
+ GraphiQL::Rails::EditorsControllerTest: test_it_uses_query_params_config
551
+ ------------------------------------------------------------------------
552
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
553
+ Parameters: {"graphql_path"=>"/my/endpoint"}
554
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (0.8ms)
555
+ Completed 200 OK in 1ms (Views: 1.0ms)
556
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
557
+ Parameters: {"graphql_path"=>"/my/endpoint"}
558
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (0.5ms)
559
+ Completed 200 OK in 1ms (Views: 0.7ms)
560
+ -------------------------------------------------
561
+ ConfigTest: test_it_adds_CSRF_header_if_requested
562
+ -------------------------------------------------
563
+ -----------------------------------------------
564
+ ConfigTest: test_it_adds_JSON_header_by_default
565
+ -----------------------------------------------
566
+ --------------------------------------------
567
+ GraphiQL::RailsTest: test_configs_can_be_set
568
+ --------------------------------------------
569
+ -------------------------------------------------
570
+ ConfigTest: test_it_adds_CSRF_header_if_requested
571
+ -------------------------------------------------
572
+ -----------------------------------------------
573
+ ConfigTest: test_it_adds_JSON_header_by_default
574
+ -----------------------------------------------
575
+ ---------------------------------------------------------------
576
+ GraphiQL::Rails::EditorsControllerTest: test_it_renders_headers
577
+ ---------------------------------------------------------------
578
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
579
+ Parameters: {"graphql_path"=>"/my/endpoint"}
580
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (138.8ms)
581
+ Completed 200 OK in 145ms (Views: 144.8ms)
582
+ ------------------------------------------------------------------------
583
+ GraphiQL::Rails::EditorsControllerTest: test_it_uses_query_params_config
584
+ ------------------------------------------------------------------------
585
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
586
+ Parameters: {"graphql_path"=>"/my/endpoint"}
587
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (0.7ms)
588
+ Completed 200 OK in 1ms (Views: 1.0ms)
589
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
590
+ Parameters: {"graphql_path"=>"/my/endpoint"}
591
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (0.7ms)
592
+ Completed 200 OK in 1ms (Views: 0.9ms)
593
+ -------------------------------------------------------------
594
+ GraphiQL::Rails::EditorsControllerTest: test_renders_GraphiQL
595
+ -------------------------------------------------------------
596
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
597
+ Parameters: {"graphql_path"=>"/my/endpoint"}
598
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (0.8ms)
599
+ Completed 200 OK in 1ms (Views: 1.0ms)
600
+ -------------------------------------------------------------------------
601
+ GraphiQL::Rails::EditorsControllerTest: test_it_uses_initial_query_config
602
+ -------------------------------------------------------------------------
603
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
604
+ Parameters: {"graphql_path"=>"/my/endpoint"}
605
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (0.8ms)
606
+ Completed 200 OK in 1ms (Views: 1.1ms)
607
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
608
+ Parameters: {"graphql_path"=>"/my/endpoint"}
609
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (0.6ms)
610
+ Completed 200 OK in 1ms (Views: 0.8ms)
611
+ ------------------------------
612
+ EngineTest: test_it_is_defined
613
+ ------------------------------
614
+ --------------------------------------------
615
+ GraphiQL::RailsTest: test_configs_can_be_set
616
+ --------------------------------------------
617
+ -------------------------------------------------
618
+ ConfigTest: test_it_adds_CSRF_header_if_requested
619
+ -------------------------------------------------
620
+ -----------------------------------------------
621
+ ConfigTest: test_it_adds_JSON_header_by_default
622
+ -----------------------------------------------
623
+ --------------------------------------------
624
+ GraphiQL::RailsTest: test_configs_can_be_set
625
+ --------------------------------------------
626
+ ---------------------------------------------------------------
627
+ GraphiQL::Rails::EditorsControllerTest: test_it_renders_headers
628
+ ---------------------------------------------------------------
629
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
630
+ Parameters: {"graphql_path"=>"/my/endpoint"}
631
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (133.2ms)
632
+ Completed 200 OK in 141ms (Views: 140.4ms)
633
+ -------------------------------------------------------------------------
634
+ GraphiQL::Rails::EditorsControllerTest: test_it_uses_initial_query_config
635
+ -------------------------------------------------------------------------
636
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
637
+ Parameters: {"graphql_path"=>"/my/endpoint"}
638
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (0.7ms)
639
+ Completed 200 OK in 1ms (Views: 1.0ms)
640
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
641
+ Parameters: {"graphql_path"=>"/my/endpoint"}
642
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (0.6ms)
643
+ Completed 200 OK in 1ms (Views: 0.8ms)
644
+ -------------------------------------------------------------
645
+ GraphiQL::Rails::EditorsControllerTest: test_renders_GraphiQL
646
+ -------------------------------------------------------------
647
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
648
+ Parameters: {"graphql_path"=>"/my/endpoint"}
649
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (0.8ms)
650
+ Completed 200 OK in 1ms (Views: 1.1ms)
651
+ ------------------------------------------------------------------------
652
+ GraphiQL::Rails::EditorsControllerTest: test_it_uses_query_params_config
653
+ ------------------------------------------------------------------------
654
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
655
+ Parameters: {"graphql_path"=>"/my/endpoint"}
656
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (0.8ms)
657
+ Completed 200 OK in 1ms (Views: 1.1ms)
658
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
659
+ Parameters: {"graphql_path"=>"/my/endpoint"}
660
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (0.6ms)
661
+ Completed 200 OK in 1ms (Views: 0.8ms)
662
+ ------------------------------
663
+ EngineTest: test_it_is_defined
664
+ ------------------------------
665
+ ------------------------------------------------------------------------
666
+ GraphiQL::Rails::EditorsControllerTest: test_it_uses_query_params_config
667
+ ------------------------------------------------------------------------
668
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
669
+ Parameters: {"graphql_path"=>"/my/endpoint"}
670
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (229.3ms)
671
+ Completed 200 OK in 240ms (Views: 239.4ms)
672
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
673
+ Parameters: {"graphql_path"=>"/my/endpoint"}
674
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (2.4ms)
675
+ Completed 200 OK in 3ms (Views: 2.9ms)
676
+ -------------------------------------------------------------------------
677
+ GraphiQL::Rails::EditorsControllerTest: test_it_uses_initial_query_config
678
+ -------------------------------------------------------------------------
679
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
680
+ Parameters: {"graphql_path"=>"/my/endpoint"}
681
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (3.3ms)
682
+ Completed 200 OK in 5ms (Views: 4.4ms)
683
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
684
+ Parameters: {"graphql_path"=>"/my/endpoint"}
685
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (2.0ms)
686
+ Completed 200 OK in 3ms (Views: 2.6ms)
687
+ -------------------------------------------------------------
688
+ GraphiQL::Rails::EditorsControllerTest: test_renders_GraphiQL
689
+ -------------------------------------------------------------
690
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
691
+ Parameters: {"graphql_path"=>"/my/endpoint"}
692
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (8.2ms)
693
+ Completed 200 OK in 9ms (Views: 9.1ms)
694
+ ---------------------------------------------------------------
695
+ GraphiQL::Rails::EditorsControllerTest: test_it_renders_headers
696
+ ---------------------------------------------------------------
697
+ Processing by GraphiQL::Rails::EditorsController#show as HTML
698
+ Parameters: {"graphql_path"=>"/my/endpoint"}
699
+ Rendered /Users/rmosolgo/projects/graphiql-rails/app/views/graphiql/rails/editors/show.html.erb (1.0ms)
700
+ Completed 200 OK in 2ms (Views: 1.6ms)
701
+ ------------------------------
702
+ EngineTest: test_it_is_defined
703
+ ------------------------------
704
+ --------------------------------------------
705
+ GraphiQL::RailsTest: test_configs_can_be_set
706
+ --------------------------------------------
707
+ -----------------------------------------------
708
+ ConfigTest: test_it_adds_JSON_header_by_default
709
+ -----------------------------------------------
710
+ -------------------------------------------------
711
+ ConfigTest: test_it_adds_CSRF_header_if_requested
712
+ -------------------------------------------------