@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/data-schema",
3
- "version": "0.18.0",
3
+ "version": "0.18.1",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -237,7 +237,7 @@ export function query(): CustomOperation<
237
237
  typeName: 'Query';
238
238
  handlers: null;
239
239
  },
240
- never,
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
- never,
261
+ 'for',
262
262
  typeof mutationBrand
263
263
  > {
264
264
  return _custom('Mutation', mutationBrand);
@@ -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(