From e1580eb5277dd13298f48b903ef77e3bbf89c321 Mon Sep 17 00:00:00 2001 From: Ryan Brink <5607577+unredundant@users.noreply.github.com> Date: Sun, 17 Jul 2022 09:33:35 -0600 Subject: [PATCH] i dont get the point of this Signed-off-by: Ryan Brink <5607577+unredundant@users.noreply.github.com> --- .../components/ApolloExplorerBrowser/index.ts | 16 +++++++++++++ .../ApolloExplorerPage/ApolloExplorerPage.tsx | 24 +++++++++++++++---- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/plugins/apollo-explorer/src/components/ApolloExplorerBrowser/index.ts b/plugins/apollo-explorer/src/components/ApolloExplorerBrowser/index.ts index e69de29bb2..d8bc44bfa7 100644 --- a/plugins/apollo-explorer/src/components/ApolloExplorerBrowser/index.ts +++ b/plugins/apollo-explorer/src/components/ApolloExplorerBrowser/index.ts @@ -0,0 +1,16 @@ +/* + * Copyright 2022 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export { ApolloExplorerBrowser } from './ApolloExplorerBrowser'; diff --git a/plugins/apollo-explorer/src/components/ApolloExplorerPage/ApolloExplorerPage.tsx b/plugins/apollo-explorer/src/components/ApolloExplorerPage/ApolloExplorerPage.tsx index b41e6aa041..c2c02fc646 100644 --- a/plugins/apollo-explorer/src/components/ApolloExplorerPage/ApolloExplorerPage.tsx +++ b/plugins/apollo-explorer/src/components/ApolloExplorerPage/ApolloExplorerPage.tsx @@ -16,15 +16,29 @@ import React from 'react'; import { Content, Header, Page } from '@backstage/core-components'; -import { - ApolloEndpointProps, - ApolloExplorerBrowser, -} from '../ApolloExplorerBrowser/ApolloExplorerBrowser'; +import { ApolloExplorerBrowser } from '../ApolloExplorerBrowser'; +import { JSONObject } from '@apollo/explorer/src/helpers/types'; + +type EndpointProps = { + title: string; + graphRef: string; + persistExplorerState?: boolean; + initialState?: { + document?: string; + variables?: JSONObject; + headers?: Record; + displayOptions: { + docsPanelState?: 'open' | 'closed'; + showHeadersAndEnvVars?: boolean; + theme?: 'dark' | 'light'; + }; + }; +}; type Props = { title?: string | undefined; subtitle?: string | undefined; - endpoints: ApolloEndpointProps[]; + endpoints: EndpointProps[]; }; export const ApolloExplorerPage = ({ title, subtitle, endpoints }: Props) => {