From 9bd1db1ed161621cde965bee0244a6a85a2c63a6 Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 5 Aug 2020 07:26:44 +0200 Subject: [PATCH] chore(gql): removing old graphql things --- plugins/bogus-graphql/.eslintrc.js | 3 -- plugins/bogus-graphql/README.md | 13 ------ plugins/bogus-graphql/package.json | 44 ------------------- plugins/bogus-graphql/scripts/mock-data.sh | 2 - plugins/bogus-graphql/src/graphql/module.ts | 47 --------------------- plugins/bogus-graphql/src/index.ts | 19 --------- plugins/bogus-graphql/src/schema.gql | 3 -- plugins/bogus-graphql/src/setupTests.ts | 18 -------- 8 files changed, 149 deletions(-) delete mode 100644 plugins/bogus-graphql/.eslintrc.js delete mode 100644 plugins/bogus-graphql/README.md delete mode 100644 plugins/bogus-graphql/package.json delete mode 100755 plugins/bogus-graphql/scripts/mock-data.sh delete mode 100644 plugins/bogus-graphql/src/graphql/module.ts delete mode 100644 plugins/bogus-graphql/src/index.ts delete mode 100644 plugins/bogus-graphql/src/schema.gql delete mode 100644 plugins/bogus-graphql/src/setupTests.ts diff --git a/plugins/bogus-graphql/.eslintrc.js b/plugins/bogus-graphql/.eslintrc.js deleted file mode 100644 index 16a033dbc6..0000000000 --- a/plugins/bogus-graphql/.eslintrc.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - extends: [require.resolve('@backstage/cli/config/eslint.backend')], -}; diff --git a/plugins/bogus-graphql/README.md b/plugins/bogus-graphql/README.md deleted file mode 100644 index 3f85ec766e..0000000000 --- a/plugins/bogus-graphql/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# graphql - -Welcome to the graphql backend plugin! - -_This plugin was created through the Backstage CLI_ - -## Getting started - -Your plugin has been added to the example app in this repository, meaning you'll be able to access it by running `yarn start` in the root directory, and then navigating to [/graphql](http://localhost:3000/graphql). - -You can also serve the plugin in isolation by running `yarn start` in the plugin directory. -This method of serving the plugin provides quicker iteration speed and a faster startup and hot reloads. -It is only meant for local development, and the setup for it can be found inside the [/dev](/dev) directory. diff --git a/plugins/bogus-graphql/package.json b/plugins/bogus-graphql/package.json deleted file mode 100644 index a5a439a701..0000000000 --- a/plugins/bogus-graphql/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "@backstage/plugin-bogus-graphql", - "version": "0.1.1-alpha.16", - "main": "src/index.ts", - "types": "src/index.ts", - "license": "Apache-2.0", - "private": true, - "publishConfig": { - "access": "public", - "main": "dist/index.esm.js", - "types": "dist/index.d.ts" - }, - "scripts": { - "start": "backstage-cli backend:dev", - "build": "backstage-cli backend:build", - "lint": "backstage-cli lint", - "test": "backstage-cli test", - "prepack": "backstage-cli prepack", - "postpack": "backstage-cli postpack", - "clean": "backstage-cli clean", - "mock-data": "./scripts/mock-data.sh" - }, - "dependencies": { - "@backstage/backend-common": "^0.1.1-alpha.16", - "@graphql-modules/core": "^0.7.17", - "@types/express": "^4.17.6", - "@types/whatwg-fetch": "^0.0.33", - "graphql": "^15.3.0", - "node-fetch": "^2.6.0", - "whatwg-fetch": "^2.0.0", - "winston": "^3.2.1", - "yn": "^4.0.0" - }, - "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.16", - "@types/supertest": "^2.0.8", - "eslint-plugin-graphql": "^4.0.0", - "msw": "^0.19.5", - "supertest": "^4.0.2" - }, - "files": [ - "dist" - ] -} diff --git a/plugins/bogus-graphql/scripts/mock-data.sh b/plugins/bogus-graphql/scripts/mock-data.sh deleted file mode 100755 index ff30921715..0000000000 --- a/plugins/bogus-graphql/scripts/mock-data.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env bash -echo "use this script to load your service with some mock data if needed!" diff --git a/plugins/bogus-graphql/src/graphql/module.ts b/plugins/bogus-graphql/src/graphql/module.ts deleted file mode 100644 index f247686ea8..0000000000 --- a/plugins/bogus-graphql/src/graphql/module.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2020 Spotify AB - * - * 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. - */ - -import { Logger } from 'winston'; -import fs from 'fs'; -import path from 'path'; -import { GraphQLModule } from '@graphql-modules/core'; - -export interface ModuleOptions { - logger: Logger; -} - -export async function createModule( - options: ModuleOptions, -): Promise { - const typeDefs = await fs.promises.readFile( - path.resolve(__dirname, '..', 'schema.gql'), - 'utf-8', - ); - - const resolvers = { - EntityMetadata: { - uppercaseName: metadata => metadata.name.toUpperCase(), - }, - }; - - const module = new GraphQLModule({ - typeDefs, - resolvers, - logger: options.logger as any, - }); - - return module; -} diff --git a/plugins/bogus-graphql/src/index.ts b/plugins/bogus-graphql/src/index.ts deleted file mode 100644 index dd6508f88a..0000000000 --- a/plugins/bogus-graphql/src/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2020 Spotify AB - * - * 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. - */ - -require('whatwg-fetch'); - -export * from './graphql/module'; diff --git a/plugins/bogus-graphql/src/schema.gql b/plugins/bogus-graphql/src/schema.gql deleted file mode 100644 index 74c0853a92..0000000000 --- a/plugins/bogus-graphql/src/schema.gql +++ /dev/null @@ -1,3 +0,0 @@ -type EntityMetadata { - uppercaseName: String -} diff --git a/plugins/bogus-graphql/src/setupTests.ts b/plugins/bogus-graphql/src/setupTests.ts deleted file mode 100644 index ac41ef995a..0000000000 --- a/plugins/bogus-graphql/src/setupTests.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2020 Spotify AB - * - * 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. - */ -require('whatwg-fetch'); - -export {};