+ Welcome to the CIViC GraphiQL Sandbox. Here you can browse the API schema + and documentation as well as view example queries in the sidebar. Click the + + icon to browse the CIViC API Documentation or click here to learn more about GraphQL. +
+diff --git a/server/Gemfile b/server/Gemfile index 26abdb0c8..f600875bd 100644 --- a/server/Gemfile +++ b/server/Gemfile @@ -50,8 +50,6 @@ gem 'typhoeus', '~>1.4.0' gem 'audited', '~> 5.3' -gem 'graphiql-rails', '~> 1.8.0' - #user comment rendering gem 'rinku', '~> 2.0.6' gem 'sanitize', '~> 6.0.2' diff --git a/server/Gemfile.lock b/server/Gemfile.lock index 13b294ddc..25c6c343f 100644 --- a/server/Gemfile.lock +++ b/server/Gemfile.lock @@ -179,9 +179,6 @@ GEM raabro (~> 1.4) globalid (1.2.1) activesupport (>= 6.1) - graphiql-rails (1.8.0) - railties - sprockets-rails graphql (1.12.24) graphql-batch (0.4.3) graphql (>= 1.3, < 2) @@ -500,7 +497,6 @@ DEPENDENCIES dockerfile-rails (>= 1.5) ed25519 elasticsearch (~> 7.13.0) - graphiql-rails (~> 1.8.0) graphql (~> 1.12.4) graphql-batch (~> 0.4.3) htmlentities (~> 4.3.4) diff --git a/server/app/assets/config/manifest.js b/server/app/assets/config/manifest.js index b46f9f8c8..591819335 100644 --- a/server/app/assets/config/manifest.js +++ b/server/app/assets/config/manifest.js @@ -1,4 +1,2 @@ //= link_tree ../images //= link_directory ../stylesheets .css -//= link graphiql/rails/application.css -//= link graphiql/rails/application.js diff --git a/server/app/controllers/graphiql_controller.rb b/server/app/controllers/graphiql_controller.rb new file mode 100644 index 000000000..cf6c03f0a --- /dev/null +++ b/server/app/controllers/graphiql_controller.rb @@ -0,0 +1,7 @@ +class GraphiqlController < ApplicationController + layout false + def show + @initial_query = GQL_EXAMPLES.initial_query + @examples = GQL_EXAMPLES.examples + end +end diff --git a/server/app/javascript/application.js b/server/app/javascript/application.js new file mode 100644 index 000000000..e69de29bb diff --git a/server/app/views/graphiql/show.html.erb b/server/app/views/graphiql/show.html.erb new file mode 100644 index 000000000..d772af57d --- /dev/null +++ b/server/app/views/graphiql/show.html.erb @@ -0,0 +1,150 @@ + + + +
++ Welcome to the CIViC GraphiQL Sandbox. Here you can browse the API schema + and documentation as well as view example queries in the sidebar. Click the + + icon to browse the CIViC API Documentation or click here to learn more about GraphQL. +
++ <%= ex["description"] %> +
+