From 67f91d49a5d765ace2e1673cc6dcc32f61707e22 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Tue, 10 Sep 2019 07:01:49 -0700 Subject: Update to graphiql-rails v1.7.10 This fixes the remaining inline JavaScript issues on this page. --- Gemfile | 2 +- Gemfile.lock | 4 +- app/views/graphiql/rails/editors/show.html.erb | 99 +++----------------------- 3 files changed, 12 insertions(+), 93 deletions(-) diff --git a/Gemfile b/Gemfile index 911635c5fc5..6344df7b68d 100644 --- a/Gemfile +++ b/Gemfile @@ -85,7 +85,7 @@ gem 'rack-cors', '~> 1.0.0', require: 'rack/cors' # GraphQL API gem 'graphql', '~> 1.9.11' # TODO: remove app/views/graphiql/rails/editors/show.html.erb when https://github.com/rmosolgo/graphiql-rails/pull/71 will be released -gem 'graphiql-rails', '~> 1.4.10' +gem 'graphiql-rails', '~> 1.7.0' gem 'apollo_upload_server', '~> 2.0.0.beta3' gem 'graphql-docs', '~> 1.6.0', group: [:development, :test] diff --git a/Gemfile.lock b/Gemfile.lock index 48053e5740e..301b54f9a9f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -398,7 +398,7 @@ GEM rake (~> 12) grape_logging (1.7.0) grape - graphiql-rails (1.4.10) + graphiql-rails (1.7.0) railties sprockets-rails graphql (1.9.11) @@ -1142,7 +1142,7 @@ DEPENDENCIES grape-entity (~> 0.7.1) grape-path-helpers (~> 1.1) grape_logging (~> 1.7) - graphiql-rails (~> 1.4.10) + graphiql-rails (~> 1.7.0) graphql (~> 1.9.11) graphql-docs (~> 1.6.0) grpc (~> 1.19.0) diff --git a/app/views/graphiql/rails/editors/show.html.erb b/app/views/graphiql/rails/editors/show.html.erb index df54b5821ee..abb1ed0e772 100644 --- a/app/views/graphiql/rails/editors/show.html.erb +++ b/app/views/graphiql/rails/editors/show.html.erb @@ -1,99 +1,18 @@ - GraphiQL + <%= GraphiQL::Rails.config.title || 'GraphiQL' %> + <%= stylesheet_link_tag("graphiql/rails/application") %> - <%# TODO: This file was included to fix a CSP failure. Please remove when https://github.com/rmosolgo/graphiql-rails/pull/71 will be released %> <%= javascript_include_tag("graphiql/rails/application", nonce: true) %> -
- Loading... -
- + <%= content_tag :div, 'Loading...', id: 'graphiql-container', data: { + graphql_endpoint_path: graphql_endpoint_path, + initial_query: GraphiQL::Rails.config.initial_query, + logo: GraphiQL::Rails.config.logo, + headers: GraphiQL::Rails.config.resolve_headers(self), + query_params: GraphiQL::Rails.config.query_params + } %> -- cgit v1.2.1