From 41a73f432d40b4b875c8d00935bd3b6b3a91c0ad Mon Sep 17 00:00:00 2001
From: Pavel Pachkovsky
Date: Fri, 28 Apr 2023 10:40:55 -0600
Subject: [PATCH] add input_value_deprecation flag
---
app/assets/javascripts/graphiql/rails/graphiql_show.js | 7 ++++++-
app/views/graphiql/rails/editors/show.html.erb | 3 ++-
lib/graphiql/rails/config.rb | 5 +++--
readme.md | 2 +-
4 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/app/assets/javascripts/graphiql/rails/graphiql_show.js b/app/assets/javascripts/graphiql/rails/graphiql_show.js
index 6b5129c..8092db3 100644
--- a/app/assets/javascripts/graphiql/rails/graphiql_show.js
+++ b/app/assets/javascripts/graphiql/rails/graphiql_show.js
@@ -77,7 +77,12 @@ document.addEventListener("DOMContentLoaded", function(event) {
// Render into the body.
- var elementProps = { fetcher: graphQLFetcher, defaultQuery: defaultQuery, headerEditorEnabled: graphiqlContainer.dataset.headerEditorEnabled === 'true' };
+ var elementProps = {
+ fetcher: graphQLFetcher,
+ defaultQuery: defaultQuery,
+ headerEditorEnabled: graphiqlContainer.dataset.headerEditorEnabled === 'true',
+ inputValueDeprecation: graphiqlContainer.dataset.inputValueDeprecation === 'true',
+ };
Object.assign(elementProps, { query: parameters.query, variables: parameters.variables })
if (queryParams === 'true') {
diff --git a/app/views/graphiql/rails/editors/show.html.erb b/app/views/graphiql/rails/editors/show.html.erb
index 1a39642..c2fdf94 100644
--- a/app/views/graphiql/rails/editors/show.html.erb
+++ b/app/views/graphiql/rails/editors/show.html.erb
@@ -13,7 +13,8 @@
logo: GraphiQL::Rails.config.logo,
headers: GraphiQL::Rails.config.resolve_headers(self),
query_params: GraphiQL::Rails.config.query_params,
- header_editor_enabled: GraphiQL::Rails.config.header_editor_enabled
+ header_editor_enabled: GraphiQL::Rails.config.header_editor_enabled,
+ input_value_deprecation: GraphiQL::Rails.config.input_value_deprecation
} %>