Deprecate packages

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2024-04-18 20:44:35 +02:00
parent 1651b0f36a
commit 58fdd20717
3 changed files with 11 additions and 105 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-apollo-explorer': patch
---
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
+2 -103
View File
@@ -1,104 +1,3 @@
# apollo-explorer
# Deprecated
Welcome to the Apollo Explorer plugin!
This plugin allows users to directly embed an [Apollo](https://www.apollographql.com) graph explorer directly into
Backstage!
## Getting started
### Getting an Apollo Graph Reference
First things first, you will need an Apollo account, and a graph imported into your account. This is beyond the scope of
this plugin, so if you are totally new to Apollo, please reference their official
documentation [here](https://www.apollographql.com/docs).
Once you have a graph set up in Apollo, we need to grab the graph reference. First, go to your Apollo graphs home page and choose the graph you wish to embed.
![Apollo Graph List](./docs/img/apollo-graph-list.png)
Once you are in your graph explorer, click the dropdown next to the share icon and select `Share as Embedded`
![Share as Embedded](./docs/img/share-as-embedded.png)
This modal contains a number of useful properties, all of which can be passed to the plugin via the component properties, but the only mandatory input we need from here is the `graphRef`.
![Graph Ref](./docs/img/graph-ref.png)
Hold on to this snippet for a second while we set up the plugin ✨
### Installing the Backstage Plugin
First, add the plugin to your Backstage app
```shell
yarn --cwd packages/app add @backstage/plugin-apollo-explorer
```
Then, in `packages/app/src/App.tsx` add the plugin as a `Route`
```typescript
import { ApolloExplorerPage } from '@backstage/plugin-apollo-explorer';
const routes = (
<FlatRoutes>
{/* other routes... */}
<Route
path="/apollo-explorer"
element={
<ApolloExplorerPage
endpoints={[
{ title: 'Github', graphRef: 'my-github-graph-ref@current' },
{ title: 'Linear', graphRef: 'my-linear-graph-ref@current' },
]}
/>
}
/>
```
Then, in `packages/app/src/components/Root/Root.tsx` add a sidebar item so users can find your beautiful plugin!
```typescript
<SidebarItem icon={GraphiQLIcon} to="apollo-explorer" text="Apollo Explorer" />
```
That's it! You should now see an `Apollo Explorer` item in your sidebar, and if you click it, you should see your graph(s) load and direct you to authenticate via Apollo!
![Needs Auth](./docs/img/needs-auth.png)
Once you authenticate, your graph is ready to use 🚀
![Logged In](./docs/img/logged-in.png)
### Authentication Tokens for Apollo Studio
If you need to utilize an ApiRef to supply a token to Apollo, you may do so using an ApiHolder.
In `packages/app/src/App.tsx` perform the following modifications from above. The import `ssoAuthApiRef` is used as an example and **does not exist**.
```typescript
import { ApolloExplorerPage, EndpointProps } from '@backstage/plugin-apollo-explorer';
import { ssoAuthApiRef } from '@companyxyz/devkit';
import { ApiHolder } from '@backstage/core-plugin-api';
async function authCallback(options: { apiHolder: ApiHolder }): Promise<{token: string}> {
const sso = options.apiHolder.get<any>(ssoAuthApiRef)
return await sso.getToken()
}
const routes = (
<FlatRoutes>
{/* other routes... */}
<Route
path="/apollo-explorer"
element={
<ApolloExplorerPage
endpoints={[{
title: 'Github',
graphRef: 'my-github-graph-ref@current',
authCallback: authCallback
}]}
/>
}
/>
```
This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-apollo-explorer` instead.
+4 -2
View File
@@ -2,7 +2,8 @@
"name": "@backstage/plugin-apollo-explorer",
"version": "0.2.0",
"backstage": {
"role": "frontend-plugin"
"role": "frontend-plugin",
"moved": "@backstage-community/plugin-apollo-explorer"
},
"publishConfig": {
"access": "public",
@@ -52,5 +53,6 @@
"react": "^16.13.1 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0",
"react-router-dom": "6.0.0-beta.0 || ^6.3.0"
}
},
"deprecated": "This package has been moved to the backstage/community-plugins repository. You should migrate to using @backstage-community/plugin-apollo-explorer instead."
}