@aws-amplify/data-schema 1.20.5 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/SchemaProcessor.js +5 -2
- package/dist/cjs/SchemaProcessor.js.map +1 -1
- package/dist/esm/ModelIndex.d.ts +2 -2
- package/dist/esm/SchemaProcessor.mjs +5 -2
- package/dist/esm/SchemaProcessor.mjs.map +1 -1
- package/dist/meta/cjs.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/ModelIndex.ts +2 -2
- package/src/SchemaProcessor.ts +8 -5
|
@@ -745,7 +745,7 @@ const transformedSecondaryIndexesForModel = (modelName, secondaryIndexes, modelF
|
|
|
745
745
|
}
|
|
746
746
|
}
|
|
747
747
|
}
|
|
748
|
-
if (!sortKeys.length && !indexName && !queryField) {
|
|
748
|
+
if (!sortKeys.length && !indexName && !queryField && queryField !== null) {
|
|
749
749
|
return `@index(queryField: "${secondaryIndexDefaultQueryField(modelName, partitionKey)}")`;
|
|
750
750
|
}
|
|
751
751
|
const attributes = [];
|
|
@@ -755,7 +755,10 @@ const transformedSecondaryIndexesForModel = (modelName, secondaryIndexes, modelF
|
|
|
755
755
|
if (sortKeys.length) {
|
|
756
756
|
attributes.push(`sortKeyFields: [${sortKeys.map((sk) => `"${sk}"`).join(', ')}]`);
|
|
757
757
|
}
|
|
758
|
-
if (queryField) {
|
|
758
|
+
if (queryField === null) {
|
|
759
|
+
attributes.push(`queryField: null`);
|
|
760
|
+
}
|
|
761
|
+
else if (queryField) {
|
|
759
762
|
attributes.push(`queryField: "${queryField}"`);
|
|
760
763
|
}
|
|
761
764
|
else {
|