@aws-amplify/graphql-transformer-core
Advanced tools
Comparing version 2.9.3 to 2.9.4-raven.0
@@ -17,2 +17,3 @@ ## API Report File for "@aws-amplify/graphql-transformer-core" | ||
import { CfnApiKey } from 'aws-cdk-lib/aws-appsync'; | ||
import { CfnFunctionConfiguration } from 'aws-cdk-lib/aws-appsync'; | ||
import { CfnGraphQLSchema } from 'aws-cdk-lib/aws-appsync'; | ||
@@ -771,5 +772,5 @@ import { CfnParameter } from 'aws-cdk-lib'; | ||
export class TransformerResolver implements TransformerResolverProvider { | ||
constructor(typeName: string, fieldName: string, resolverLogicalId: string, requestMappingTemplate: MappingTemplateProvider, responseMappingTemplate: MappingTemplateProvider, requestSlots: string[], responseSlots: string[], datasource?: DataSourceProvider | undefined); | ||
constructor(typeName: string, fieldName: string, resolverLogicalId: string, requestMappingTemplate: MappingTemplateProvider, responseMappingTemplate: MappingTemplateProvider, requestSlots: string[], responseSlots: string[], datasource?: DataSourceProvider | undefined, runtime?: CfnFunctionConfiguration.AppSyncRuntimeProperty | undefined); | ||
// (undocumented) | ||
addToSlot: (slotName: string, requestMappingTemplate?: MappingTemplateProvider, responseMappingTemplate?: MappingTemplateProvider, dataSource?: DataSourceProvider) => void; | ||
addToSlot: (slotName: string, requestMappingTemplate?: MappingTemplateProvider, responseMappingTemplate?: MappingTemplateProvider, dataSource?: DataSourceProvider, runtime?: CfnFunctionConfiguration.AppSyncRuntimeProperty) => void; | ||
// Warning: (ae-forgotten-export) The symbol "Slot" needs to be exported by the entry point index.d.ts | ||
@@ -776,0 +777,0 @@ // |
import { MappingTemplateProvider } from '@aws-amplify/graphql-transformer-interfaces'; | ||
import { BaseDataSource } from 'aws-cdk-lib/aws-appsync'; | ||
import { BaseDataSource, CfnFunctionConfiguration } from 'aws-cdk-lib/aws-appsync'; | ||
import { Construct } from 'constructs'; | ||
@@ -13,2 +13,3 @@ import { GraphQLApi } from './graphql-api'; | ||
readonly dataSource: BaseDataSource | string; | ||
readonly runtime: CfnFunctionConfiguration.AppSyncRuntimeProperty | undefined; | ||
} | ||
@@ -15,0 +16,0 @@ export declare class AppSyncFunctionConfiguration extends Construct { |
@@ -10,23 +10,34 @@ "use strict"; | ||
constructor(scope, id, props) { | ||
var _a; | ||
var _a, _b; | ||
super(scope, id); | ||
const requestTemplate = props.requestMappingTemplate.bind(this, props.api.assetProvider); | ||
const responseTemplate = props.responseMappingTemplate.bind(this, props.api.assetProvider); | ||
this.function = new aws_appsync_1.CfnFunctionConfiguration(this, `${id}.AppSyncFunction`, { | ||
name: id, | ||
apiId: props.api.apiId, | ||
functionVersion: '2018-05-29', | ||
description: props.description, | ||
dataSourceName: props.dataSource instanceof aws_appsync_1.BaseDataSource ? props.dataSource.ds.attrName : props.dataSource, | ||
...(props.requestMappingTemplate instanceof template_asset_1.InlineTemplate | ||
? { requestMappingTemplate: requestTemplate } | ||
: { requestMappingTemplateS3Location: requestTemplate }), | ||
...(props.responseMappingTemplate instanceof template_asset_1.InlineTemplate | ||
? { responseMappingTemplate: responseTemplate } | ||
: { responseMappingTemplateS3Location: responseTemplate }), | ||
}); | ||
this.function = | ||
((_a = props.runtime) === null || _a === void 0 ? void 0 : _a.name) === 'APPSYNC_JS' | ||
? new aws_appsync_1.CfnFunctionConfiguration(this, `${id}.AppSyncFunction`, { | ||
name: id, | ||
apiId: props.api.apiId, | ||
functionVersion: '2018-05-29', | ||
description: props.description, | ||
dataSourceName: props.dataSource instanceof aws_appsync_1.BaseDataSource ? props.dataSource.ds.attrName : props.dataSource, | ||
code: requestTemplate + '\n\n' + responseTemplate, | ||
runtime: props.runtime, | ||
}) | ||
: new aws_appsync_1.CfnFunctionConfiguration(this, `${id}.AppSyncFunction`, { | ||
name: id, | ||
apiId: props.api.apiId, | ||
functionVersion: '2018-05-29', | ||
description: props.description, | ||
dataSourceName: props.dataSource instanceof aws_appsync_1.BaseDataSource ? props.dataSource.ds.attrName : props.dataSource, | ||
...(props.requestMappingTemplate instanceof template_asset_1.InlineTemplate | ||
? { requestMappingTemplate: requestTemplate } | ||
: { requestMappingTemplateS3Location: requestTemplate }), | ||
...(props.responseMappingTemplate instanceof template_asset_1.InlineTemplate | ||
? { responseMappingTemplate: responseTemplate } | ||
: { responseMappingTemplateS3Location: responseTemplate }), | ||
}); | ||
(0, utils_1.setResourceName)(this.function, { name: id }); | ||
props.api.addSchemaDependency(this.function); | ||
if (props.dataSource instanceof aws_appsync_1.BackedDataSource) { | ||
this.function.addDependency((_a = props.dataSource) === null || _a === void 0 ? void 0 : _a.ds); | ||
this.function.addDependency((_b = props.dataSource) === null || _b === void 0 ? void 0 : _b.ds); | ||
} | ||
@@ -33,0 +44,0 @@ this.arn = this.function.attrFunctionArn; |
import { DynamoDbDataSourceOptions, MappingTemplateProvider, SearchableDataSourceOptions, TransformHostProvider, VpcConfig } from '@aws-amplify/graphql-transformer-interfaces'; | ||
import { BaseDataSource, DataSourceOptions, DynamoDbDataSource, HttpDataSource, HttpDataSourceOptions, LambdaDataSource, NoneDataSource, CfnResolver } from 'aws-cdk-lib/aws-appsync'; | ||
import { BaseDataSource, DataSourceOptions, DynamoDbDataSource, HttpDataSource, HttpDataSourceOptions, LambdaDataSource, NoneDataSource, CfnResolver, CfnFunctionConfiguration } from 'aws-cdk-lib/aws-appsync'; | ||
import { ITable } from 'aws-cdk-lib/aws-dynamodb'; | ||
@@ -30,4 +30,4 @@ import { IRole } from 'aws-cdk-lib/aws-iam'; | ||
addLambdaDataSource: (name: string, lambdaFunction: IFunction, options?: DataSourceOptions, scope?: Construct) => LambdaDataSource; | ||
addAppSyncFunction: (name: string, requestMappingTemplate: MappingTemplateProvider, responseMappingTemplate: MappingTemplateProvider, dataSourceName: string, scope?: Construct) => AppSyncFunctionConfiguration; | ||
addResolver: (typeName: string, fieldName: string, requestMappingTemplate: MappingTemplateProvider, responseMappingTemplate: MappingTemplateProvider, resolverLogicalId?: string, dataSourceName?: string, pipelineConfig?: string[], scope?: Construct) => CfnResolver; | ||
addAppSyncFunction: (name: string, requestMappingTemplate: MappingTemplateProvider, responseMappingTemplate: MappingTemplateProvider, dataSourceName: string, scope?: Construct, runtime?: CfnFunctionConfiguration.AppSyncRuntimeProperty) => AppSyncFunctionConfiguration; | ||
addResolver: (typeName: string, fieldName: string, requestMappingTemplate: MappingTemplateProvider, responseMappingTemplate: MappingTemplateProvider, resolverLogicalId?: string, dataSourceName?: string, pipelineConfig?: string[], scope?: Construct, runtime?: CfnFunctionConfiguration.AppSyncRuntimeProperty) => CfnResolver; | ||
addLambdaFunction: (functionName: string, functionKey: string, handlerName: string, filePath: string, runtime: Runtime, layers?: ILayerVersion[], role?: IRole, environment?: { | ||
@@ -34,0 +34,0 @@ [key: string]: string; |
@@ -61,3 +61,3 @@ "use strict"; | ||
}; | ||
this.addAppSyncFunction = (name, requestMappingTemplate, responseMappingTemplate, dataSourceName, scope) => { | ||
this.addAppSyncFunction = (name, requestMappingTemplate, responseMappingTemplate, dataSourceName, scope, runtime) => { | ||
if (dataSourceName && !aws_cdk_lib_1.Token.isUnresolved(dataSourceName) && !this.dataSources.has(dataSourceName)) { | ||
@@ -84,2 +84,3 @@ throw new Error(`DataSource ${dataSourceName} is missing in the API`); | ||
responseMappingTemplate, | ||
runtime, | ||
}); | ||
@@ -89,3 +90,3 @@ this.appsyncFunctions.set(slotHash, fn); | ||
}; | ||
this.addResolver = (typeName, fieldName, requestMappingTemplate, responseMappingTemplate, resolverLogicalId, dataSourceName, pipelineConfig, scope) => { | ||
this.addResolver = (typeName, fieldName, requestMappingTemplate, responseMappingTemplate, resolverLogicalId, dataSourceName, pipelineConfig, scope, runtime) => { | ||
if (dataSourceName && !aws_cdk_lib_1.Token.isUnresolved(dataSourceName) && !this.dataSources.has(dataSourceName)) { | ||
@@ -119,2 +120,15 @@ throw new Error(`DataSource ${dataSourceName} is missing in the API`); | ||
if (pipelineConfig) { | ||
const runtimeSpecificArgs = (runtime === null || runtime === void 0 ? void 0 : runtime.name) === 'APPSYNC_JS' | ||
? { | ||
code: requestTemplateLocation + '\n\n' + responseTemplateLocation, | ||
runtime, | ||
} | ||
: { | ||
...(requestMappingTemplate instanceof template_asset_1.InlineTemplate | ||
? { requestMappingTemplate: requestTemplateLocation } | ||
: { requestMappingTemplateS3Location: requestTemplateLocation }), | ||
...(responseMappingTemplate instanceof template_asset_1.InlineTemplate | ||
? { responseMappingTemplate: responseTemplateLocation } | ||
: { responseMappingTemplateS3Location: responseTemplateLocation }), | ||
}; | ||
const resolver = new aws_appsync_1.CfnResolver(scope || this.api, resolverName, { | ||
@@ -125,11 +139,6 @@ apiId: this.api.apiId, | ||
kind: 'PIPELINE', | ||
...(requestMappingTemplate instanceof template_asset_1.InlineTemplate | ||
? { requestMappingTemplate: requestTemplateLocation } | ||
: { requestMappingTemplateS3Location: requestTemplateLocation }), | ||
...(responseMappingTemplate instanceof template_asset_1.InlineTemplate | ||
? { responseMappingTemplate: responseTemplateLocation } | ||
: { responseMappingTemplateS3Location: responseTemplateLocation }), | ||
pipelineConfig: { | ||
functions: pipelineConfig, | ||
}, | ||
...runtimeSpecificArgs, | ||
}); | ||
@@ -136,0 +145,0 @@ resolver.overrideLogicalId(resourceId); |
import { AppSyncFunctionConfigurationProvider, DataSourceProvider, GraphQLAPIProvider, MappingTemplateProvider, TransformerContextProvider, TransformerResolverProvider, TransformerResolversManagerProvider } from '@aws-amplify/graphql-transformer-interfaces'; | ||
import { CfnFunctionConfiguration } from 'aws-cdk-lib/aws-appsync'; | ||
import { Stack } from 'aws-cdk-lib'; | ||
@@ -8,2 +9,3 @@ import { Construct } from 'constructs'; | ||
dataSource?: DataSourceProvider; | ||
runtime?: CfnFunctionConfiguration.AppSyncRuntimeProperty; | ||
}; | ||
@@ -31,9 +33,10 @@ export declare const NONE_DATA_SOURCE_NAME = "NONE_DS"; | ||
private datasource?; | ||
private runtime?; | ||
private readonly slotMap; | ||
private readonly slotNames; | ||
private scope?; | ||
constructor(typeName: string, fieldName: string, resolverLogicalId: string, requestMappingTemplate: MappingTemplateProvider, responseMappingTemplate: MappingTemplateProvider, requestSlots: string[], responseSlots: string[], datasource?: DataSourceProvider | undefined); | ||
constructor(typeName: string, fieldName: string, resolverLogicalId: string, requestMappingTemplate: MappingTemplateProvider, responseMappingTemplate: MappingTemplateProvider, requestSlots: string[], responseSlots: string[], datasource?: DataSourceProvider | undefined, runtime?: CfnFunctionConfiguration.AppSyncRuntimeProperty | undefined); | ||
mapToStack: (stack: Stack) => void; | ||
setScope: (scope: Construct) => void; | ||
addToSlot: (slotName: string, requestMappingTemplate?: MappingTemplateProvider, responseMappingTemplate?: MappingTemplateProvider, dataSource?: DataSourceProvider) => void; | ||
addToSlot: (slotName: string, requestMappingTemplate?: MappingTemplateProvider, responseMappingTemplate?: MappingTemplateProvider, dataSource?: DataSourceProvider, runtime?: CfnFunctionConfiguration.AppSyncRuntimeProperty) => void; | ||
slotExists: (slotName: string, requestMappingTemplate?: MappingTemplateProvider, responseMappingTemplate?: MappingTemplateProvider) => boolean; | ||
@@ -46,4 +49,5 @@ findSlot: (slotName: string, requestMappingTemplate?: MappingTemplateProvider, responseMappingTemplate?: MappingTemplateProvider) => Slot | undefined; | ||
private ensureNoneDataSource; | ||
private stashStatementGenerator; | ||
} | ||
export {}; | ||
//# sourceMappingURL=resolver.d.ts.map |
@@ -72,3 +72,3 @@ "use strict"; | ||
class TransformerResolver { | ||
constructor(typeName, fieldName, resolverLogicalId, requestMappingTemplate, responseMappingTemplate, requestSlots, responseSlots, datasource) { | ||
constructor(typeName, fieldName, resolverLogicalId, requestMappingTemplate, responseMappingTemplate, requestSlots, responseSlots, datasource, runtime) { | ||
this.typeName = typeName; | ||
@@ -82,2 +82,3 @@ this.fieldName = fieldName; | ||
this.datasource = datasource; | ||
this.runtime = runtime; | ||
this.slotMap = new Map(); | ||
@@ -90,3 +91,3 @@ this.mapToStack = (stack) => { | ||
}; | ||
this.addToSlot = (slotName, requestMappingTemplate, responseMappingTemplate, dataSource) => { | ||
this.addToSlot = (slotName, requestMappingTemplate, responseMappingTemplate, dataSource, runtime) => { | ||
if (!this.slotNames.has(slotName)) { | ||
@@ -110,2 +111,3 @@ throw new Error(`Resolver is missing slot ${slotName}`); | ||
dataSource, | ||
runtime, | ||
}); | ||
@@ -148,3 +150,3 @@ } | ||
this.synthesize = (context, api) => { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l; | ||
const scope = this.scope || context.stackManager.scope; | ||
@@ -155,3 +157,4 @@ this.ensureNoneDataSource(api); | ||
[this.requestMappingTemplate, this.requestMappingTemplate].map((template) => this.substituteSlotInfo(template, 'main', 0)); | ||
const dataSourceProviderFn = api.host.addAppSyncFunction((0, graphql_transformer_common_1.toPascalCase)([this.typeName, this.fieldName, 'DataResolverFn']), this.requestMappingTemplate, this.responseMappingTemplate, ((_a = this.datasource) === null || _a === void 0 ? void 0 : _a.name) || exports.NONE_DATA_SOURCE_NAME, scope); | ||
const dataSourceProviderFn = api.host.addAppSyncFunction((0, graphql_transformer_common_1.toPascalCase)([this.typeName, this.fieldName, 'DataResolverFn']), this.requestMappingTemplate, this.responseMappingTemplate, ((_a = this.datasource) === null || _a === void 0 ? void 0 : _a.name) || exports.NONE_DATA_SOURCE_NAME, scope, this.runtime); | ||
const stashStatement = this.stashStatementGenerator(this.runtime); | ||
let dataSourceType = 'NONE'; | ||
@@ -165,3 +168,3 @@ let dataSource = ''; | ||
const tableName = (_b = this.datasource.ds.dynamoDbConfig) === null || _b === void 0 ? void 0 : _b.tableName; | ||
dataSource = `$util.qr($ctx.stash.put("tableName", "${tableName}"))`; | ||
dataSource = stashStatement('tableName', `"${tableName}"`); | ||
if (((_c = this.datasource.ds.dynamoDbConfig) === null || _c === void 0 ? void 0 : _c.deltaSyncConfig) && | ||
@@ -182,3 +185,3 @@ !(0, aws_cdk_lib_1.isResolvableObject)((_d = this.datasource.ds.dynamoDbConfig) === null || _d === void 0 ? void 0 : _d.deltaSyncConfig)) { | ||
}); | ||
dataSource += `\n$util.qr($ctx.stash.put("deltaSyncTableTtl", ${deltaSyncTableTtl}))`; | ||
dataSource += '\n' + stashStatement('deltaSyncTableTtl', `"${deltaSyncTableTtl}"`); | ||
} | ||
@@ -208,3 +211,3 @@ } | ||
const endpoint = (_e = this.datasource.ds.elasticsearchConfig) === null || _e === void 0 ? void 0 : _e.endpoint; | ||
dataSource = `$util.qr($ctx.stash.put("endpoint", "${endpoint}"))`; | ||
dataSource = stashStatement('endpoint', `"${endpoint}"`); | ||
} | ||
@@ -215,3 +218,3 @@ break; | ||
const lambdaFunctionArn = (_f = this.datasource.ds.lambdaConfig) === null || _f === void 0 ? void 0 : _f.lambdaFunctionArn; | ||
dataSource = `$util.qr($ctx.stash.put("lambdaFunctionArn", "${lambdaFunctionArn}"))`; | ||
dataSource = stashStatement('lambdaFunctionArn', `"${lambdaFunctionArn}"`); | ||
} | ||
@@ -222,3 +225,3 @@ break; | ||
const endpoint = (_g = this.datasource.ds.httpConfig) === null || _g === void 0 ? void 0 : _g.endpoint; | ||
dataSource = `$util.qr($ctx.stash.put("endpoint", "${endpoint}"))`; | ||
dataSource = stashStatement('endpoint', `"${endpoint}"`); | ||
} | ||
@@ -231,3 +234,3 @@ break; | ||
const databaseName = (_j = this.datasource.ds.relationalDatabaseConfig) === null || _j === void 0 ? void 0 : _j.rdsHttpEndpointConfig.databaseName; | ||
dataSource = `$util.qr($ctx.stash.metadata.put("databaseName", "${databaseName}"))`; | ||
dataSource = stashStatement('databaseName', `"${databaseName}"`); | ||
} | ||
@@ -240,9 +243,9 @@ break; | ||
let initResolver = (0, ts_dedent_1.dedent) ` | ||
$util.qr($ctx.stash.put("typeName", "${this.typeName}")) | ||
$util.qr($ctx.stash.put("fieldName", "${this.fieldName}")) | ||
$util.qr($ctx.stash.put("conditions", [])) | ||
$util.qr($ctx.stash.put("metadata", {})) | ||
$util.qr($ctx.stash.metadata.put("dataSourceType", "${dataSourceType}")) | ||
$util.qr($ctx.stash.metadata.put("apiId", "${api.apiId}")) | ||
$util.qr($ctx.stash.put("connectionAttributes", {})) | ||
${stashStatement('typeName', `"${this.typeName}"`)} | ||
${stashStatement('fieldName', `"${this.fieldName}"`)} | ||
${stashStatement('conditions', '[]')} | ||
${stashStatement('metadata', '{}')} | ||
${stashStatement('dataSourceType', `"${dataSourceType}"`, 'metadata')} | ||
${stashStatement('apiId', `"${api.apiId}"`, 'metadata')} | ||
${stashStatement('connectionAttributes', '{}')} | ||
${dataSource} | ||
@@ -253,4 +256,5 @@ `; | ||
if (authRole) { | ||
const authRoleStatement = stashStatement('authRole', `"arn:aws:sts::${account}:assumed-role/${authRole}/CognitoIdentityCredentials"`); | ||
initResolver += (0, ts_dedent_1.dedent) `\n | ||
$util.qr($ctx.stash.put("authRole", "arn:aws:sts::${account}:assumed-role/${authRole}/CognitoIdentityCredentials")) | ||
${authRoleStatement} | ||
`; | ||
@@ -260,4 +264,5 @@ } | ||
if (unauthRole) { | ||
const unauthRoleStatement = stashStatement('unauthRole', `"arn:aws:sts::${account}:assumed-role/${unauthRole}/CognitoIdentityCredentials"`); | ||
initResolver += (0, ts_dedent_1.dedent) `\n | ||
$util.qr($ctx.stash.put("unauthRole", "arn:aws:sts::${account}:assumed-role/${unauthRole}/CognitoIdentityCredentials")) | ||
${unauthRoleStatement} | ||
`; | ||
@@ -267,13 +272,32 @@ } | ||
if (identityPoolId) { | ||
const identityPoolStatement = stashStatement('identityPoolId', `"${identityPoolId}"`); | ||
initResolver += (0, ts_dedent_1.dedent) `\n | ||
$util.qr($ctx.stash.put("identityPoolId", "${identityPoolId}")) | ||
${identityPoolStatement} | ||
`; | ||
} | ||
const adminRoles = (_k = context.synthParameters.adminRoles) !== null && _k !== void 0 ? _k : []; | ||
const adminRolesStatement = stashStatement('adminRoles', `${JSON.stringify(adminRoles)}`); | ||
initResolver += (0, ts_dedent_1.dedent) `\n | ||
$util.qr($ctx.stash.put("adminRoles", ${JSON.stringify(adminRoles)})) | ||
${adminRolesStatement} | ||
`; | ||
initResolver += '\n$util.toJson({})'; | ||
api.host.addResolver(this.typeName, this.fieldName, cdk_compat_1.MappingTemplate.inlineTemplateFromString(initResolver), cdk_compat_1.MappingTemplate.inlineTemplateFromString('$util.toJson($ctx.prev.result)'), this.resolverLogicalId, undefined, [...requestFns, dataSourceProviderFn, ...responseFns].map((fn) => fn.functionId), scope); | ||
if (((_l = this.runtime) === null || _l === void 0 ? void 0 : _l.name) === 'APPSYNC_JS') { | ||
initResolver = (0, ts_dedent_1.dedent) ` | ||
export const request = (ctx) => { | ||
${initResolver} | ||
return {}; | ||
} | ||
`; | ||
} | ||
else { | ||
initResolver += '\n$util.toJson({})'; | ||
} | ||
const initResponseResolver = this.runtime | ||
? (0, ts_dedent_1.dedent) ` | ||
export const response = (ctx) => { | ||
return ctx.prev.result; | ||
}; | ||
` | ||
: '$util.toJson($ctx.prev.result)'; | ||
api.host.addResolver(this.typeName, this.fieldName, cdk_compat_1.MappingTemplate.inlineTemplateFromString(initResolver), cdk_compat_1.MappingTemplate.inlineTemplateFromString(initResponseResolver), this.resolverLogicalId, undefined, [...requestFns, dataSourceProviderFn, ...responseFns].map((fn) => fn.functionId), scope, this.runtime); | ||
}; | ||
this.synthesizeResolvers = (scope, api, slotsNames) => { | ||
@@ -290,3 +314,3 @@ const appSyncFunctions = []; | ||
responseMappingTemplate && this.substituteSlotInfo(responseMappingTemplate, slotName, index); | ||
const fn = api.host.addAppSyncFunction(name, requestMappingTemplate || cdk_compat_1.MappingTemplate.inlineTemplateFromString('$util.toJson({})'), responseMappingTemplate || cdk_compat_1.MappingTemplate.inlineTemplateFromString('$util.toJson({})'), (dataSource === null || dataSource === void 0 ? void 0 : dataSource.name) || exports.NONE_DATA_SOURCE_NAME, scope); | ||
const fn = api.host.addAppSyncFunction(name, requestMappingTemplate || cdk_compat_1.MappingTemplate.inlineTemplateFromString('$util.toJson({})'), responseMappingTemplate || cdk_compat_1.MappingTemplate.inlineTemplateFromString('$util.toJson({})'), (dataSource === null || dataSource === void 0 ? void 0 : dataSource.name) || exports.NONE_DATA_SOURCE_NAME, scope, slotItem.runtime); | ||
appSyncFunctions.push(fn); | ||
@@ -333,4 +357,15 @@ } | ||
} | ||
stashStatementGenerator(runtime) { | ||
const jsStashStatement = (name, value, object) => { | ||
const objectPrefix = object ? `.${object}` : ''; | ||
return `ctx.stash${objectPrefix}.${name} = ${value};`; | ||
}; | ||
const vtlStashStatement = (name, value, object) => { | ||
const objectPrefix = object ? `.${object}` : ''; | ||
return `$util.qr($ctx.stash${objectPrefix}.put("${name}", ${value}))`; | ||
}; | ||
return (runtime === null || runtime === void 0 ? void 0 : runtime.name) === 'APPSYNC_JS' ? jsStashStatement : vtlStashStatement; | ||
} | ||
} | ||
exports.TransformerResolver = TransformerResolver; | ||
//# sourceMappingURL=resolver.js.map |
@@ -109,3 +109,5 @@ "use strict"; | ||
type = | ||
(0, graphql_transformer_common_1.isScalar)(field.type) || (0, graphql_transformer_common_1.isEnum)(field.type, document) | ||
(0, graphql_transformer_common_1.isScalar)(field.type) || | ||
(0, graphql_transformer_common_1.isEnum)(field.type, document) || | ||
(field.type.kind === graphql_1.Kind.NAMED_TYPE && field.type.name.value === 'ConversationMessageSender') | ||
? field.type | ||
@@ -112,0 +114,0 @@ : (0, graphql_transformer_common_1.withNamedNodeNamed)(field.type, graphql_transformer_common_1.ModelResourceIDs.NonModelInputObjectName((0, graphql_transformer_common_1.getBaseType)(field.type))); |
{ | ||
"name": "@aws-amplify/graphql-transformer-core", | ||
"version": "2.9.3", | ||
"version": "2.9.4-raven.0", | ||
"description": "A framework to transform from GraphQL SDL to AWS CloudFormation.", | ||
@@ -31,4 +31,4 @@ "repository": { | ||
"dependencies": { | ||
"@aws-amplify/graphql-directives": "1.1.0", | ||
"@aws-amplify/graphql-transformer-interfaces": "3.10.1", | ||
"@aws-amplify/graphql-directives": "1.1.1-raven.0", | ||
"@aws-amplify/graphql-transformer-interfaces": "3.10.2-raven.0", | ||
"fs-extra": "^8.1.0", | ||
@@ -91,3 +91,3 @@ "graphql": "^15.5.0", | ||
}, | ||
"gitHead": "1cdf6b3886e79240b8c95e3c513e2556a7ef0380" | ||
"gitHead": "9da7fb8edb329a8ae01f234150dfc0bc7e07788f" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
653850
5585
2
+ Added@aws-amplify/graphql-directives@1.1.1-raven.0(transitive)
+ Added@aws-amplify/graphql-transformer-interfaces@3.10.2-raven.0(transitive)
- Removed@aws-amplify/graphql-directives@1.1.0(transitive)
- Removed@aws-amplify/graphql-transformer-interfaces@3.10.1(transitive)
Updated@aws-amplify/graphql-transformer-interfaces@3.10.2-raven.0