Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aws-amplify/graphql-http-transformer

Package Overview
Dependencies
Maintainers
6
Versions
407
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-amplify/graphql-http-transformer - npm Package Compare versions

Comparing version 0.3.3-flutter-preview.26 to 0.3.3-flutter-preview.27

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

## [0.3.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/graphql-http-transformer@0.3.2...@aws-amplify/graphql-http-transformer@0.3.3) (2021-06-24)
### Bug Fixes
* correct 'tranformer' typo ([#7408](https://github.com/aws-amplify/amplify-cli/issues/7408)) ([9420f1b](https://github.com/aws-amplify/amplify-cli/commit/9420f1b29137fd7621d7d902a147e596776357df))
## [0.3.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/graphql-http-transformer@0.3.1...@aws-amplify/graphql-http-transformer@0.3.2) (2021-05-26)

@@ -8,0 +19,0 @@

21

lib/graphql-http-transformer.js

@@ -124,2 +124,3 @@ "use strict";

const env = context.stackManager.getParameter(graphql_transformer_common_1.ResourceConstants.PARAMETERS.Env);
const region = stack.region;
stack.templateOptions.templateFormatVersion = '2010-09-09';

@@ -130,3 +131,3 @@ stack.templateOptions.description = 'An auto-generated nested stack for the @http directive.';

if (context.api.getDataSource(dataSourceId) === undefined) {
context.api.addHttpDataSource(dataSourceId, replaceEnv(env, directive.origin), {}, stack);
context.api.addHttpDataSource(dataSourceId, replaceEnvAndRegion(env, region, directive.origin), {}, stack);
}

@@ -141,2 +142,3 @@ createResolver(stack, dataSourceId, context, directive);

const env = context.stackManager.getParameter(graphql_transformer_common_1.ResourceConstants.PARAMETERS.Env);
const region = stack.region;
const { method, supportsBody } = config;

@@ -173,3 +175,3 @@ const reqCompoundExpr = [];

}));
const requestTemplateString = replaceEnv(env, graphql_mapping_template_1.printBlock('Create request')(graphql_mapping_template_1.compoundExpression(reqCompoundExpr)));
const requestTemplateString = replaceEnvAndRegion(env, region, graphql_mapping_template_1.printBlock('Create request')(graphql_mapping_template_1.compoundExpression(reqCompoundExpr)));
const requestMappingTemplate = cdk.Token.isUnresolved(requestTemplateString)

@@ -180,9 +182,14 @@ ? graphql_transformer_core_1.MappingTemplate.inlineTemplateFromString(requestTemplateString)

}
function replaceEnv(env, value) {
if (!value.includes('${env}')) {
function replaceEnvAndRegion(env, region, value) {
const vars = {};
if (value.includes('${env}')) {
vars.env = env;
}
if (value.includes('${aws_region}')) {
vars.aws_region = region;
}
if (Object.keys(vars).length === 0) {
return value;
}
return cdk.Fn.sub(value, {
env: env,
});
return cdk.Fn.sub(value, vars);
}

@@ -189,0 +196,0 @@ function makeUrlParamInputObject(directive, urlParams) {

{
"name": "@aws-amplify/graphql-http-transformer",
"version": "0.3.3-flutter-preview.26+def25777c",
"description": "Amplify GraphQL @http tranformer",
"version": "0.3.3-flutter-preview.27+37710261c",
"description": "Amplify GraphQL @http transformer",
"repository": {

@@ -30,8 +30,8 @@ "type": "git",

"dependencies": {
"@aws-amplify/graphql-transformer-core": "0.6.2-flutter-preview.26+def25777c",
"@aws-amplify/graphql-transformer-interfaces": "1.6.1-flutter-preview.41+def25777c",
"@aws-amplify/graphql-transformer-core": "0.6.2-flutter-preview.27+37710261c",
"@aws-amplify/graphql-transformer-interfaces": "1.6.1-flutter-preview.42+37710261c",
"@aws-cdk/core": "~1.72.0",
"graphql": "^14.5.8",
"graphql-mapping-template": "4.18.2-flutter-preview.572+def25777c",
"graphql-transformer-common": "4.19.4-flutter-preview.96+def25777c"
"graphql-mapping-template": "4.18.2-flutter-preview.573+37710261c",
"graphql-transformer-common": "4.19.4-flutter-preview.97+37710261c"
},

@@ -56,3 +56,3 @@ "devDependencies": {

},
"gitHead": "def25777c52cacff0da7849e19dcae8428b84fcc"
"gitHead": "37710261cd3f413a2922982998eff635e8425041"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc