From 9e3c813b7e177effa801bb8562d8462e1a041f6b Mon Sep 17 00:00:00 2001 From: Rob Dominguez Date: Mon, 12 Jun 2023 07:18:05 -0500 Subject: [PATCH] docs: add sanity bearing additions PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9423 GitOrigin-RevId: 7ba96b5fb1431267530673f86ac6685d4a408b0d --- docs/src/components/Feedback/Feedback.tsx | 6 ++++-- docs/src/components/GraphiQLIDE/index.tsx | 19 +++++++++---------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/docs/src/components/Feedback/Feedback.tsx b/docs/src/components/Feedback/Feedback.tsx index bc297719ca5..27ffe79981a 100644 --- a/docs/src/components/Feedback/Feedback.tsx +++ b/docs/src/components/Feedback/Feedback.tsx @@ -53,8 +53,10 @@ export const Feedback = ({ metadata }: { metadata: any }) => { .catch(error => console.error('error', error)); }; - if (window.location.hostname === 'localhost') { - alert('Testing feedback (not) sent!'); + if (window.location.hostname != 'hasura.io' || window.location.hostname != 'stage.hasura.io') { + alert( + 'Hey! We like that you like our docs and chose to use them 🎉\n\nHowever, you might want to remove the feedback component or modify the route you hit, lest you want us reading what people think of your site ✌️' + ); setRating(null); setNotes(null); setIsSubmitSuccess(true); diff --git a/docs/src/components/GraphiQLIDE/index.tsx b/docs/src/components/GraphiQLIDE/index.tsx index a16e0d1d7d6..ef7378f4720 100644 --- a/docs/src/components/GraphiQLIDE/index.tsx +++ b/docs/src/components/GraphiQLIDE/index.tsx @@ -1,13 +1,18 @@ import React from 'react'; import GraphiQL from 'graphiql'; -import useIsBrowser from '@docusaurus/useIsBrowser'; import cslx from 'clsx'; -import { createGraphiQLFetcher } from '@graphiql/toolkit'; import 'graphiql/graphiql.min.css'; import './styles.scss'; const GraphiQLIDE = ({ query, variables, response, viewOnly = true }) => { - const isBrowser = useIsBrowser(); + const notReal = async ({ query }) => { + return { + data: { + easterEgg: `This query and response is for demo purposes only. Running it doesn't actually hit an API. Refresh the page to see the original response.`, + }, + }; + }; + return (
{ readOnly={false} editorTheme={'dracula'} schema={null} - fetcher={ - isBrowser - ? createGraphiQLFetcher({ - url: 'https://hasura.io/graphql', // TODO: update later - }) - : () => null - } + fetcher={notReal} query={query} variables={variables} response={response}