From fd26698a4241358535216758f2e775fba6ad37a9 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Fri, 2 Sep 2022 13:04:37 +0200 Subject: [PATCH] graphiql: switch GraphiQLPage to .jsx Signed-off-by: Patrik Oldsberg --- .changeset/shaggy-buses-juggle.md | 5 +++++ .../GraphiQLPage/{GraphiQLPage.tsx => GraphiQLPage.jsx} | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 .changeset/shaggy-buses-juggle.md rename plugins/graphiql/src/components/GraphiQLPage/{GraphiQLPage.tsx => GraphiQLPage.jsx} (89%) diff --git a/.changeset/shaggy-buses-juggle.md b/.changeset/shaggy-buses-juggle.md new file mode 100644 index 0000000000..f43747a877 --- /dev/null +++ b/.changeset/shaggy-buses-juggle.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-graphiql': patch +--- + +Internal refactor diff --git a/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.tsx b/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.jsx similarity index 89% rename from plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.tsx rename to plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.jsx index 0b4399948a..a23193de39 100644 --- a/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.tsx +++ b/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.jsx @@ -13,6 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +// @ts-check +// NOTE: This file is intentionally .jsx, so that there is one file in this repo where we make sure .jsx files work. + import React from 'react'; import { useApi } from '@backstage/core-plugin-api'; import useAsync from 'react-use/lib/useAsync'; @@ -33,7 +37,8 @@ export const GraphiQLPage = () => { const graphQlBrowseApi = useApi(graphQlBrowseApiRef); const endpoints = useAsync(() => graphQlBrowseApi.getEndpoints()); - let content: JSX.Element; + /** @type JSX.Element */ + let content; if (endpoints.loading) { content = ( @@ -53,7 +58,7 @@ export const GraphiQLPage = () => { } else { content = ( - + ); }