|
const readSchemaFile = |
|
schemaRelPath => fs.readFileSync(path.join(servicePath, schemaRelPath), { encoding: 'utf8' }); |
|
|
|
const schemaContent = |
|
Array.isArray(config.schema) ? |
|
mergeTypes(config.schema.map(readSchemaFile)) : |
|
readSchemaFile(config.schema || 'schema.graphql'); |
This (somewhat explicitly in the name) assumes that the config.schema would be a relative path, but that is not documented.
- Is there a particular reason for this requirement, or could this be relaxed?
diff --git a/src/get-config.js b/src/get-config.js
index 597e084..17e1764 100644
--- a/src/get-config.js
+++ b/src/get-config.js
@@ -59,7 +59,7 @@ const getConfig = (config, provider, servicePath) => {
const mappingTemplates = config.mappingTemplates || [];
const readSchemaFile =
- schemaRelPath => fs.readFileSync(path.join(servicePath, schemaRelPath), { encoding: 'utf8' });
+ schemaPath => fs.readFileSync(path.resolve(servicePath, schemaPath), { encoding: 'utf8' });
const schemaContent =
Array.isArray(config.schema) ?
- If there is a reason, would you accept a PR to clarify the documentation?
serverless-appsync-plugin/src/get-config.js
Lines 61 to 67 in 18644ea
This (somewhat explicitly in the name) assumes that the
config.schemawould be a relative path, but that is not documented.