graphiql-rails 1.10.1 → 1.10.2

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
  SHA256:
3
- metadata.gz: 2bb2bddfc0b2587d29cf66abf18a0724e466e545a463284856b326d7f0700b11
4
- data.tar.gz: 65cfeb3de3240f61a3a2fd61cce3c0b69ad2b047f3b6fb79c9bc8d1e581236d5
3
+ metadata.gz: bb48ffa87661b8bcaac6fd6a3459436164e5a45edbeae979c854e9d7671e99c5
4
+ data.tar.gz: c70dd2be7e09d39a55f93da49421456520b38090fd1412e2abd54f8cc530870b
5
5
  SHA512:
6
- metadata.gz: e0a6354fa1941ebb35193475d1c4c3148d9b34282506a6e7d13be10b62f754e11bc8c69d832bf7541fc211fa080dffaeaddedf504d6767fb835a9ca8d40d8e5f
7
- data.tar.gz: 36c186c3162afd63f4e80f044bc9d3008b2c6aeb2f9272fe4e416563a8b480eefecd599d96e530d955a0f28595eec299424432893e2973a3a32f117a39a0df20
6
+ metadata.gz: 52c51ed3a533b33271895bcfbb05a7030bbcb52055d58cc3ec323d20c245bb81a2c8340eeb629f3cbab7c9299e38d697ca289d8a7f21416da24945983cdd1f28
7
+ data.tar.gz: 81d878695bb1951431a5904ac1db18c2cff48c4f8d99b1a43ffbd96614b6f454fc21913546d5f103703d9cc1e562455575039d89c0f8dd4f4e684ff9aede16a0
@@ -26,11 +26,13 @@ document.addEventListener("DOMContentLoaded", function (_) {
26
26
 
27
27
  // Render <GraphiQL /> into the body.
28
28
  const initialQuery = graphiqlContainer.dataset.initialQuery;
29
+ const shouldPersistHeaders = graphiqlContainer.dataset.shouldPersistHeaders;
29
30
  let elementProps = {
30
31
  fetcher: graphQLFetcher,
31
32
  defaultQuery: initialQuery ? initialQuery : undefined,
32
33
  headerEditorEnabled: graphiqlContainer.dataset.headerEditorEnabled === 'true',
33
34
  inputValueDeprecation: graphiqlContainer.dataset.inputValueDeprecation === 'true',
35
+ shouldPersistHeaders: shouldPersistHeaders ? shouldPersistHeaders === 'true' : undefined
34
36
  };
35
37
 
36
38
  if (graphiqlContainer.dataset.queryParams === 'true') {
@@ -85,4 +87,4 @@ document.addEventListener("DOMContentLoaded", function (_) {
85
87
  ),
86
88
  document.getElementById("graphiql-container")
87
89
  );
88
- });
90
+ });
@@ -13,7 +13,12 @@
13
13
  <%= stylesheet_link_tag("graphiql/rails/application") %>
14
14
  <%= javascript_include_tag("graphiql/rails/application", nonce: true ) %>
15
15
  <% else %>
16
- <% raise "GraphiQL::Rails requires either Propshaft or Sprockets. Use `$ bundle add propshaft` or `$ bundle add sprockets-rails` to add one of them to your app." %>
16
+ <%= stylesheet_link_tag("/graphiql-rails/stylesheets/graphiql-3.1.1.css") %>
17
+ <%= stylesheet_link_tag("/graphiql-rails/stylesheets/application.css?v=#{GraphiQL::Rails::VERSION}") %>
18
+ <%= javascript_include_tag("/graphiql-rails/javascripts/react-18.2.0.js", nonce: true) %>
19
+ <%= javascript_include_tag("/graphiql-rails/javascripts/react-dom-18.2.0.js", nonce: true) %>
20
+ <%= javascript_include_tag("/graphiql-rails/javascripts/graphiql-3.1.1.js", nonce: true) %>
21
+ <%= javascript_include_tag("/graphiql-rails/javascripts/graphiql_show.js?v=#{GraphiQL::Rails::VERSION}", nonce: true) %>
17
22
  <% end %>
18
23
  </head>
19
24
  <body>
@@ -24,7 +29,8 @@
24
29
  headers: GraphiQL::Rails.config.resolve_headers(self),
25
30
  query_params: GraphiQL::Rails.config.query_params,
26
31
  header_editor_enabled: GraphiQL::Rails.config.header_editor_enabled,
27
- input_value_deprecation: GraphiQL::Rails.config.input_value_deprecation
32
+ input_value_deprecation: GraphiQL::Rails.config.input_value_deprecation,
33
+ should_persist_headers: GraphiQL::Rails.config.should_persist_headers
28
34
  } %>
29
35
  </body>
30
36
  </html>
@@ -7,7 +7,7 @@ module GraphiQL
7
7
  # @return [Hash<String => Proc>] Keys are headers to include in GraphQL requests, values are `->(view_context) { ... }` procs to determin values
8
8
  attr_accessor :headers
9
9
 
10
- attr_accessor :query_params, :initial_query, :csrf, :title, :logo, :header_editor_enabled, :input_value_deprecation
10
+ attr_accessor :query_params, :initial_query, :csrf, :title, :logo, :header_editor_enabled, :input_value_deprecation, :should_persist_headers
11
11
 
12
12
  DEFAULT_HEADERS = {
13
13
  'Content-Type' => ->(_) { 'application/json' },
@@ -11,6 +11,12 @@ module GraphiQL
11
11
  )
12
12
  end
13
13
  end
14
+
15
+ if !defined?(Sprockets) && !defined?(Propshaft)
16
+ initializer 'graphiql.assets.public' do |app|
17
+ app.middleware.insert_after(ActionDispatch::Static, ActionDispatch::Static, "#{root}/public")
18
+ end
19
+ end
14
20
  end
15
21
  end
16
22
  end
@@ -1,5 +1,5 @@
1
1
  module GraphiQL
2
2
  module Rails
3
- VERSION = "1.10.1"
3
+ VERSION = "1.10.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphiql-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.1
4
+ version: 1.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Mosolgo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-15 00:00:00.000000000 Z
11
+ date: 2025-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: puma
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
125
139
  description: Use the GraphiQL IDE for GraphQL with Ruby on Rails. This gem includes
126
140
  an engine, a controller and a view for integrating GraphiQL with your app.
127
141
  email: