chore(gql/catalog): fixing bundling of graphql asse

This commit is contained in:
blam
2020-08-10 11:46:54 +02:00
parent be1c526708
commit 8fc45676bf
2 changed files with 8 additions and 5 deletions
+2 -1
View File
@@ -44,6 +44,7 @@
"supertest": "^4.0.2"
},
"files": [
"dist"
"dist",
"schema.gql"
]
}
@@ -28,13 +28,15 @@ export interface ModuleOptions {
config: Config;
}
const schemaPath = path.resolve(
require.resolve('@backstage/plugin-graphql-backend/package.json'),
'../schema.gql',
);
export async function createModule(
options: ModuleOptions,
): Promise<GraphQLModule> {
const typeDefs = await fs.promises.readFile(
path.resolve(__dirname, '..', 'schema.gql'),
'utf-8',
);
const typeDefs = await fs.promises.readFile(schemaPath, 'utf-8');
const catalogClient = new CatalogClient(
options.config.getString('backend.baseUrl'),