graphql-transformer-common
Advanced tools
Comparing version 4.26.0-rds-2.0 to 4.26.0-rds-3.0
@@ -73,5 +73,2 @@ ## API Report File for "graphql-transformer-common" | ||
// @public (undocumented) | ||
export const findMatchingField: (field: FieldDefinitionNode, objectType: ObjectTypeDefinitionNode, document: DocumentNode) => FieldDefinitionNode | undefined; | ||
// @public (undocumented) | ||
export const findObjectDefinition: (document: DocumentNode, name: string) => ObjectTypeDefinitionNode | undefined; | ||
@@ -78,0 +75,0 @@ |
@@ -6,7 +6,12 @@ # Change Log | ||
# [4.26.0-rds-2.0](https://github.com/aws-amplify/amplify-category-api/compare/graphql-transformer-common@4.25.1...graphql-transformer-common@4.26.0-rds-2.0) (2023-09-07) | ||
# [4.26.0-rds-3.0](https://github.com/aws-amplify/amplify-category-api/compare/graphql-transformer-common@4.25.1...graphql-transformer-common@4.26.0-rds-3.0) (2023-10-03) | ||
### Bug Fixes | ||
- handle field names starting with number ([2e9de1b](https://github.com/aws-amplify/amplify-category-api/commit/2e9de1b061ac212fad23b133ada44bfaadb1a2ff)) | ||
### Features | ||
- **api:** add arrays and objects support for rds datasource ([cbfb017](https://github.com/aws-amplify/amplify-category-api/commit/cbfb017029e45c6e7cb8fea4250794d02afff4ca)) | ||
- infer and preserve field mappings in schema ([4f8e7f4](https://github.com/aws-amplify/amplify-category-api/commit/4f8e7f43e6ba3e64702baffe60b8b4870d37ffb6)) | ||
@@ -13,0 +18,0 @@ ## [4.25.1](https://github.com/aws-amplify/amplify-category-api/compare/graphql-transformer-common@4.25.0...graphql-transformer-common@4.25.1) (2023-08-30) |
@@ -43,3 +43,2 @@ import { ObjectTypeDefinitionNode, InputValueDefinitionNode, FieldDefinitionNode, TypeNode, SchemaDefinitionNode, OperationTypeNode, OperationTypeDefinitionNode, ObjectTypeExtensionNode, NamedTypeNode, NonNullTypeNode, ListTypeNode, ArgumentNode, DirectiveNode, EnumTypeDefinitionNode, ValueNode, InputObjectTypeDefinitionNode, UnionTypeDefinitionNode, DocumentNode, DefinitionNode } from 'graphql'; | ||
export declare function makeListType(type: TypeNode): ListTypeNode; | ||
export declare const findMatchingField: (field: FieldDefinitionNode, objectType: ObjectTypeDefinitionNode, document: DocumentNode) => FieldDefinitionNode | undefined; | ||
export declare const findObjectDefinition: (document: DocumentNode, name: string) => ObjectTypeDefinitionNode | undefined; | ||
@@ -46,0 +45,0 @@ export declare const isNamedType: (type: TypeNode) => boolean; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isOfType = exports.directiveExists = exports.isNonModelType = exports.getNonModelTypes = exports.isNamedType = exports.findObjectDefinition = exports.findMatchingField = exports.makeListType = exports.makeNonNullType = exports.makeNamedType = exports.makeInputValueDefinition = exports.makeValueNode = exports.makeArgument = exports.makeDirective = exports.makeField = exports.makeObjectDefinition = exports.makeInputObjectDefinition = exports.defineUnionType = exports.extendFieldWithDirectives = exports.extensionWithDirectives = exports.extensionWithFields = exports.blankObjectExtension = exports.blankObject = exports.makeSchema = exports.makeOperationType = exports.wrapNonNull = exports.unwrapNonNull = exports.getDirectiveArgument = exports.isNonNullType = exports.isListType = exports.getBaseType = exports.isEnum = exports.isArrayOrObject = exports.isScalarOrEnum = exports.isScalar = exports.attributeTypeFromScalar = exports.MAP_SCALARS = exports.NUMERIC_SCALARS = exports.DEFAULT_SCALARS = exports.APPSYNC_DEFINED_SCALARS = exports.STANDARD_SCALARS = void 0; | ||
exports.isOfType = exports.directiveExists = exports.isNonModelType = exports.getNonModelTypes = exports.isNamedType = exports.findObjectDefinition = exports.makeListType = exports.makeNonNullType = exports.makeNamedType = exports.makeInputValueDefinition = exports.makeValueNode = exports.makeArgument = exports.makeDirective = exports.makeField = exports.makeObjectDefinition = exports.makeInputObjectDefinition = exports.defineUnionType = exports.extendFieldWithDirectives = exports.extensionWithDirectives = exports.extensionWithFields = exports.blankObjectExtension = exports.blankObject = exports.makeSchema = exports.makeOperationType = exports.wrapNonNull = exports.unwrapNonNull = exports.getDirectiveArgument = exports.isNonNullType = exports.isListType = exports.getBaseType = exports.isEnum = exports.isArrayOrObject = exports.isScalarOrEnum = exports.isScalar = exports.attributeTypeFromScalar = exports.MAP_SCALARS = exports.NUMERIC_SCALARS = exports.DEFAULT_SCALARS = exports.APPSYNC_DEFINED_SCALARS = exports.STANDARD_SCALARS = void 0; | ||
const graphql_1 = require("graphql"); | ||
@@ -394,11 +394,2 @@ exports.STANDARD_SCALARS = { | ||
exports.makeListType = makeListType; | ||
const findMatchingField = (field, objectType, document) => { | ||
var _a, _b; | ||
const matchingObject = (0, exports.findObjectDefinition)(document, (_a = objectType === null || objectType === void 0 ? void 0 : objectType.name) === null || _a === void 0 ? void 0 : _a.value); | ||
if (!matchingObject) { | ||
return; | ||
} | ||
return (_b = matchingObject === null || matchingObject === void 0 ? void 0 : matchingObject.fields) === null || _b === void 0 ? void 0 : _b.find((f) => { var _a, _b; return ((_a = f === null || f === void 0 ? void 0 : f.name) === null || _a === void 0 ? void 0 : _a.value) === ((_b = field === null || field === void 0 ? void 0 : field.name) === null || _b === void 0 ? void 0 : _b.value); }); | ||
}; | ||
exports.findMatchingField = findMatchingField; | ||
const findObjectDefinition = (document, name) => { | ||
@@ -405,0 +396,0 @@ var _a; |
@@ -54,3 +54,5 @@ "use strict"; | ||
function toCamelCase(words) { | ||
const formatted = words.map((w, i) => (i === 0 ? w.charAt(0).toLowerCase() + w.slice(1) : w.charAt(0).toUpperCase() + w.slice(1))); | ||
const formatted = words | ||
.filter((w) => (w === null || w === void 0 ? void 0 : w.length) > 0) | ||
.map((w, i) => (i === 0 ? w.charAt(0).toLowerCase() + w.slice(1) : w.charAt(0).toUpperCase() + w.slice(1))); | ||
return formatted.join(''); | ||
@@ -57,0 +59,0 @@ } |
{ | ||
"name": "graphql-transformer-common", | ||
"version": "4.26.0-rds-2.0", | ||
"version": "4.26.0-rds-3.0", | ||
"description": "Common code and constants for AppSync Transformers", | ||
@@ -28,3 +28,3 @@ "repository": { | ||
"graphql": "^15.5.0", | ||
"graphql-mapping-template": "4.20.13-rds-2.0", | ||
"graphql-mapping-template": "4.20.13-rds-3.0", | ||
"md5": "^2.2.1", | ||
@@ -40,5 +40,5 @@ "pluralize": "8.0.0" | ||
"global": { | ||
"branches": 30, | ||
"functions": 19, | ||
"lines": 30 | ||
"branches": 17, | ||
"functions": 17, | ||
"lines": 34 | ||
} | ||
@@ -60,3 +60,3 @@ }, | ||
}, | ||
"gitHead": "b0257bd87b199069cb66625d6554377dc65c4c8a" | ||
"gitHead": "c1efd4e687969d2cb64361ee656b7ce99a5eebb8" | ||
} |
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
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
223366
1566
+ Addedgraphql-mapping-template@4.20.13-rds-3.0(transitive)
- Removedgraphql-mapping-template@4.20.13-rds-2.0(transitive)