@aws-amplify/data-schema 1.20.2 → 1.20.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/data-schema",
3
- "version": "1.20.2",
3
+ "version": "1.20.4",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -913,17 +913,16 @@ function mapToNativeAppSyncAuthDirectives(
913
913
  } else {
914
914
  rules.add(provider);
915
915
  }
916
-
917
- groupProvider.forEach((groups, provider) => {
918
- rules.add(
919
- `${provider}(cognito_groups: [${Array.from(groups)
920
- .map((group) => `"${group}"`)
921
- .join(', ')}])`,
922
- );
923
- // example: (cognito_groups: ["Bloggers", "Readers"])
924
- })
925
916
  }
926
917
 
918
+ groupProvider.forEach((groups, provider) => {
919
+ rules.add(
920
+ `${provider}(cognito_groups: [${Array.from(groups)
921
+ .map((group) => `"${group}"`)
922
+ .join(', ')}])`,
923
+ );
924
+ // example: (cognito_groups: ["Bloggers", "Readers"])
925
+ })
927
926
 
928
927
  const authString = [...rules].join(' ');
929
928
 
@@ -1156,9 +1156,12 @@ export function buildGraphQLVariables(
1156
1156
  modelIntrospection,
1157
1157
  ),
1158
1158
  ).filter(([fieldName]) => {
1159
- const { isReadOnly } = fields[fieldName];
1160
-
1161
- return !isReadOnly;
1159
+ // omit field from update input
1160
+ // if exists in fields and marked read only
1161
+ // if does not exist in fields but implicitly added to schema via ownership
1162
+ return fields[fieldName]
1163
+ ? !fields[fieldName].isReadOnly
1164
+ : !resolveOwnerFields(modelDefinition).includes(fieldName);
1162
1165
  }),
1163
1166
  )
1164
1167
  : {},