Skip to content

Commit 96e65de

Browse files
committed
fix the gem to use assets without sprokets
1 parent f47d940 commit 96e65de

File tree

6 files changed

+6
-28
lines changed

6 files changed

+6
-28
lines changed

app/assets/stylesheets/graphiql/rails/application.css

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
/*
2-
= require ./graphiql-2.4.0
3-
*/
4-
51
html, body, #graphiql-container {
62
height: 100%;
73
margin: 0;

app/views/graphiql/rails/editors/show.html.erb

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@
33
<head>
44
<title><%= GraphiQL::Rails.config.title || 'GraphiQL' %></title>
55

6+
<%= stylesheet_link_tag("graphiql/rails/graphiql-2.4.0") %>
67
<%= stylesheet_link_tag("graphiql/rails/application") %>
7-
<%= javascript_include_tag("graphiql/rails/application", nonce: true ) %>
8+
<%= javascript_include_tag("graphiql/rails/react-17.0.2", nonce: true ) %>
9+
<%= javascript_include_tag("graphiql/rails/react-dom-17.0.2", nonce: true ) %>
10+
<%= javascript_include_tag("graphiql/rails/fetch-0.10.1", nonce: true ) %>
11+
<%= javascript_include_tag("graphiql/rails/graphiql-2.4.0", nonce: true ) %>
12+
<%= javascript_include_tag("graphiql/rails/graphiql_show", nonce: true ) %>
813
</head>
914
<body>
1015
<%= content_tag :div, 'Loading...', id: 'graphiql-container', data: {

graphiql-rails.gemspec

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ Gem::Specification.new do |s|
1818
s.files = Dir["{app,config,lib}/**/*"]
1919

2020
s.add_runtime_dependency "railties"
21-
s.add_runtime_dependency "sprockets-rails"
2221

2322
s.add_development_dependency "rails"
2423
s.add_development_dependency "sqlite3"

readme.md

-21
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,6 @@ end
3131
- `at:` is the path where GraphiQL will be served. You can access GraphiQL by visiting that path in your app.
3232
- `graphql_path:` is the path to the GraphQL endpoint. GraphiQL will send queries to this path.
3333

34-
#### Note on API Mode
35-
36-
If you're using Rails 6 in "API mode", you'll also need to do the following:
37-
38-
1. Add `require "sprockets/railtie"` to your `application.rb`.
39-
40-
2. Create an `app/assets/config/manifest.js` file and add the following:
41-
42-
```
43-
//= link graphiql/rails/application.css
44-
//= link graphiql/rails/application.js
45-
```
46-
47-
Additionally, for Rails 6, you'll also need to add `sass-rails` gem to your Gemfile and add a `manifest.js` file for Sprockets 4 to work:
48-
```
49-
--- add to `app/assets/config/manifest.js`
50-
//= link graphiql/rails/application.css
51-
//= link graphiql/rails/application.js
52-
```
53-
See more details in [issue #13](https://github.com/rmosolgo/graphiql-rails/issues/13#issuecomment-640366886)
54-
5534
### Configuration
5635

5736
You can override `GraphiQL::Rails.config` values in an initializer (eg, `config/initializers/graphiql.rb`). The configs are:

test/dummy/app/assets/config/manifest.js

Whitespace-only changes.

test/dummy/config/application.rb

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
require "action_controller/railtie"
44
require "action_mailer/railtie"
5-
require "sprockets/railtie"
65
require "rails/test_unit/railtie"
76

87
# Require the gems listed in Gemfile, including any gems

0 commit comments

Comments
 (0)