-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved pipeline handling #296
Changes from 3 commits
30c100f
971454d
ba7b048
17e59b3
84a5a65
ff57092
1c76301
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -825,11 +825,11 @@ class ServerlessAppsyncPlugin { | |
return flattenedFunctionConfigurationResources.reduce((acc, tpl) => { | ||
const reqTemplPath = path.join( | ||
functionConfigLocation, | ||
tpl.request || `${tpl.type}.${tpl.field}.request.vtl`, | ||
tpl.request || `${tpl.name}.request.vtl`, | ||
); | ||
const respTemplPath = path.join( | ||
functionConfigLocation, | ||
tpl.response || `${tpl.type}.${tpl.field}.response.vtl`, | ||
tpl.response || `${tpl.name}.response.vtl`, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @markvp I understand you point. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Given that functions don't have a type or a field, I'm not sure how anyone could have used this functionality in the past? I certainly couldn't get it to work. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @markvp After giving it a second thought and having a deeper analysis on this, I think you are right. I'll accept this change 👍 |
||
); | ||
const requestTemplate = fs.readFileSync(reqTemplPath, 'utf8'); | ||
const responseTemplate = fs.readFileSync(respTemplPath, 'utf8'); | ||
|
@@ -872,8 +872,10 @@ class ServerlessAppsyncPlugin { | |
const flattenedMappingTemplates = config.mappingTemplates | ||
.reduce((accumulator, currentValue) => accumulator.concat(currentValue), []); | ||
return flattenedMappingTemplates.reduce((acc, tpl) => { | ||
const reqTemplPath = path.join(config.mappingTemplatesLocation, tpl.request || `${tpl.type}.${tpl.field}.request.vtl`); | ||
const respTemplPath = path.join(config.mappingTemplatesLocation, tpl.response || `${tpl.type}.${tpl.field}.response.vtl`); | ||
const reqSuffix = tpl.kind === 'PIPELINE' ? 'before' : 'request'; | ||
const respSuffix = tpl.kind === 'PIPELINE' ? 'after' : 'response'; | ||
const reqTemplPath = path.join(config.mappingTemplatesLocation, tpl.request || `${tpl.type}.${tpl.field}.${reqSuffix}.vtl`); | ||
const respTemplPath = path.join(config.mappingTemplatesLocation, tpl.response || `${tpl.type}.${tpl.field}.${respSuffix}.vtl`); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @markvp This however is a breaking change. I see no problem in adding support for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm. I understand the desire for backwards compatibility. Not sure the best way to implement that. Perhaps checking for file existence first? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @markvp 🤔 Well, in CloudFormations (and in this plugin), even if in the doc they refer to it as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok. removed before/after update for now |
||
const requestTemplate = fs.readFileSync(reqTemplPath, 'utf8'); | ||
const responseTemplate = fs.readFileSync(respTemplPath, 'utf8'); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@markvp
type
does not takePIPELINE
as a value, it's underkind
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops. fixed.