Deprecate packages

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2024-04-18 20:47:57 +02:00
parent 57b9de5772
commit 5ce702f794
3 changed files with 10 additions and 70 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-graphiql': patch
---
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
+2 -69
View File
@@ -1,70 +1,3 @@
# @backstage/plugin-graphiql
# Deprecated
This plugin integrates [GraphiQL](https://github.com/graphql/graphiql) as a tool to browse GraphiQL endpoints inside Backstage.
The purpose of the plugin is to provide a convenient way for developers to try out GraphQL queries in their own environment.
By exposing GraphiQL as a plugin instead of a standalone app, it's possible to provide a preconfigured environment for engineers, and also tie into authentication providers already inside Backstage.
## Getting Started
### Installing the plugin
Start out by installing the plugin in your Backstage app:
```bash
# From your Backstage root directory
yarn --cwd packages/app add @backstage/plugin-graphiql
```
```diff
# in packages/app/src/App.tsx
+import { GraphiQLPage } from '@backstage/plugin-graphiql';
const routes = (
<FlatRoutes>
+ <Route path="/graphiql" element={<GraphiQLPage />} />
```
### Adding GraphQL endpoints
For the plugin to function, you need to supply GraphQL endpoints through the GraphQLBrowse API. This is done by implementing the `graphQlBrowseApiRef` exported by this plugin.
If all you need is a static list of endpoints, the plugin exports a `GraphQLEndpoints` class that implements the `GraphQLBrowseApi` for you. Here's an example of how you could expose two GraphQL endpoints in your App:
```diff
# in packages/app/src/apis.ts
+import {
+ graphQlBrowseApiRef,
+ GraphQLEndpoints,
+} from '@backstage/plugin-graphiql';
export const apis = [
+ createApiFactory({
+ api: graphQlBrowseApiRef,
+ deps: { errorApi: errorApiRef, githubAuthApi: githubAuthApiRef },
+ factory: ({ errorApi, githubAuthApi }) =>
+ GraphQLEndpoints.from([
+ // Use the .create function if all you need is a static URL and headers.
+ GraphQLEndpoints.create({
+ id: 'gitlab',
+ title: 'GitLab',
+ url: 'https://gitlab.com/api/graphql',
+ // Optional extra headers
+ headers: { Extra: 'Header' },
+ }),
+ {
+ id: 'hooli-search',
+ title: 'Hooli Search',
+ // Custom fetch function, this one is equivalent to using GraphQLEndpoints.create()
+ // with url set to https://internal.hooli.com/search
+ fetcher: async (params: any) => {
+ return fetch('https://internal.hooli.com/search', {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify(params),
+ }).then(res => res.json());
+ },
+ }
+ ]),
+ }),
```
This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-graphiql` instead.
+3 -1
View File
@@ -3,7 +3,8 @@
"version": "0.3.7",
"description": "Backstage plugin for browsing GraphQL APIs",
"backstage": {
"role": "frontend-plugin"
"role": "frontend-plugin",
"moved": "@backstage-community/plugin-graphiql"
},
"publishConfig": {
"access": "public"
@@ -74,6 +75,7 @@
"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-graphiql instead.",
"experimentalInstallationRecipe": {
"type": "frontend-plugin",
"steps": [