first commit
This commit is contained in:
30
.graphqlrc.js
Normal file
30
.graphqlrc.js
Normal file
@@ -0,0 +1,30 @@
|
||||
const fs = require("node:fs");
|
||||
|
||||
function getConfig() {
|
||||
const config = {
|
||||
projects: {},
|
||||
};
|
||||
|
||||
let extensions = [];
|
||||
try {
|
||||
extensions = fs.readdirSync("./extensions");
|
||||
} catch {
|
||||
// ignore if no extensions
|
||||
}
|
||||
|
||||
for (const entry of extensions) {
|
||||
const extensionPath = `./extensions/${entry}`;
|
||||
const schema = `${extensionPath}/schema.graphql`;
|
||||
if (!fs.existsSync(schema)) {
|
||||
continue;
|
||||
}
|
||||
config.projects[entry] = {
|
||||
schema,
|
||||
documents: [`${extensionPath}/**/*.graphql`],
|
||||
};
|
||||
}
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
module.exports = getConfig();
|
||||
Reference in New Issue
Block a user