Merge branch 'master' of github.com:spotify/backstage into mob/catalog-in-gql
* 'master' of github.com:spotify/backstage: (73 commits) chore(gql): graphql should be public chore(deps): bump chokidar from 3.4.0 to 3.4.1 (#1818) chore(deps-dev): bump @types/nodegit from 0.26.5 to 0.26.7 (#1817) chore(deps-dev): bump @testing-library/react-hooks from 3.3.0 to 3.4.1 (#1820) Mob/techdocs end to end (#1736) chore(scaffolder): updating the wording for the sample templates chore(deps): bump react-use from 14.2.0 to 15.3.3 workflows: run cli checks on changes to create-app create-app: sync version create-app: fix deps create-app: add lint command feat(create-app): add missing template backend package plugins/graphql: fix schema packaging create-app: packaging fixes fix(create-app): update entrypoint feat: fallback to string value if config value is not json yarn.lock: security fix (#1797) fix(cli): add create-app import to e2e tests cli: just print warning if postpack fails broken link to create an app ...
This commit is contained in:
@@ -25,6 +25,11 @@ import { ApolloServer } from 'apollo-server-express';
|
||||
import { createModule as createCatalogModule } from '@backstage/plugin-catalog-graphql';
|
||||
import { createModule as createBogusModule } from '@backstage/plugin-bogus-graphql';
|
||||
|
||||
const schemaPath = path.resolve(
|
||||
require.resolve('@backstage/plugin-graphql-backend/package.json'),
|
||||
'../schema.gql',
|
||||
);
|
||||
|
||||
export interface RouterOptions {
|
||||
logger: Logger;
|
||||
}
|
||||
@@ -32,10 +37,7 @@ export interface RouterOptions {
|
||||
export async function createRouter(
|
||||
options: RouterOptions,
|
||||
): Promise<express.Router> {
|
||||
const typeDefs = await fs.promises.readFile(
|
||||
path.resolve(__dirname, '..', 'schema.gql'),
|
||||
'utf-8',
|
||||
);
|
||||
const typeDefs = await fs.promises.readFile(schemaPath, 'utf-8');
|
||||
|
||||
const catalogModule = await createCatalogModule(options);
|
||||
const bogusModule = await createBogusModule(options);
|
||||
|
||||
Reference in New Issue
Block a user