@aws-amplify/data-schema 0.18.0 → 0.18.1
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 +3 -0
- package/dist/cjs/SchemaProcessor.js.map +1 -1
- package/dist/esm/CustomOperation.d.ts +2 -2
- package/dist/esm/SchemaProcessor.mjs +3 -0
- package/dist/esm/SchemaProcessor.mjs.map +1 -1
- package/dist/meta/cjs.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/CustomOperation.ts +2 -2
- package/src/SchemaProcessor.ts +6 -0
package/package.json
CHANGED
package/src/CustomOperation.ts
CHANGED
|
@@ -237,7 +237,7 @@ export function query(): CustomOperation<
|
|
|
237
237
|
typeName: 'Query';
|
|
238
238
|
handlers: null;
|
|
239
239
|
},
|
|
240
|
-
|
|
240
|
+
'for',
|
|
241
241
|
typeof queryBrand
|
|
242
242
|
> {
|
|
243
243
|
return _custom('Query', queryBrand);
|
|
@@ -258,7 +258,7 @@ export function mutation(): CustomOperation<
|
|
|
258
258
|
typeName: 'Mutation';
|
|
259
259
|
handlers: null;
|
|
260
260
|
},
|
|
261
|
-
|
|
261
|
+
'for',
|
|
262
262
|
typeof mutationBrand
|
|
263
263
|
> {
|
|
264
264
|
return _custom('Mutation', mutationBrand);
|
package/src/SchemaProcessor.ts
CHANGED
|
@@ -1270,6 +1270,12 @@ function validateCustomOperations(
|
|
|
1270
1270
|
}
|
|
1271
1271
|
}
|
|
1272
1272
|
|
|
1273
|
+
if (opType !== 'Subscription' && subscriptionSource.length > 0) {
|
|
1274
|
+
throw new Error(
|
|
1275
|
+
`The .for() modifier function can only be used with a custom subscription. ${typeName} is not a custom subscription.`,
|
|
1276
|
+
);
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1273
1279
|
if (opType === 'Subscription') {
|
|
1274
1280
|
if (subscriptionSource.length < 1) {
|
|
1275
1281
|
throw new Error(
|