@aws-amplify/data-schema-types
Advanced tools
Comparing version 0.7.17 to 0.8.0
@@ -176,5 +176,5 @@ import type { DeepReadOnlyObject, UnwrapArray, UnionToIntersection, Prettify, Equal } from '../util'; | ||
*/ | ||
type MutationInput<Fields, ModelMeta extends Record<any, any>, RelationalFields = ModelMeta['relationalInputFields'], WritableFields = Pick<Fields, WritableKeys<Fields>>> = { | ||
type MutationInput<Fields, WritableFields = Pick<Fields, WritableKeys<Fields>>> = { | ||
[Prop in keyof WritableFields as WritableFields[Prop] extends (...args: any) => any ? never : Prop]: WritableFields[Prop]; | ||
} & RelationalFields; | ||
}; | ||
/** | ||
@@ -185,3 +185,3 @@ * All identifiers and fields used to create a model | ||
id: string; | ||
}> extends true ? Partial<ModelIdentifier<ModelMeta>> & Omit<MutationInput<Model, ModelMeta>, 'id'> : MutationInput<Model, ModelMeta>; | ||
}> extends true ? Partial<ModelIdentifier<ModelMeta>> & Omit<MutationInput<Model>, 'id'> : MutationInput<Model>; | ||
/** | ||
@@ -337,3 +337,3 @@ * See: https://spec.graphql.org/draft/#sec-Errors | ||
}) => SingularReturnValue<Model>; | ||
update: (model: Prettify<ModelIdentifier<ModelMeta> & Partial<MutationInput<Model, ModelMeta>>>, options?: { | ||
update: (model: Prettify<ModelIdentifier<ModelMeta> & Partial<MutationInput<Model>>>, options?: { | ||
authMode?: AuthMode; | ||
@@ -398,3 +398,3 @@ authToken?: string; | ||
}) => SingularReturnValue<Model>; | ||
update: (model: Prettify<ModelIdentifier<ModelMeta> & Partial<MutationInput<Model, ModelMeta>>>, options?: { | ||
update: (model: Prettify<ModelIdentifier<ModelMeta> & Partial<MutationInput<Model>>>, options?: { | ||
authMode?: AuthMode; | ||
@@ -432,3 +432,3 @@ authToken?: string; | ||
}) => SingularReturnValue<Model>; | ||
update: (contextSpec: any, model: Prettify<ModelIdentifier<ModelMeta> & Partial<MutationInput<Model, ModelMeta>>>, options?: { | ||
update: (contextSpec: any, model: Prettify<ModelIdentifier<ModelMeta> & Partial<MutationInput<Model>>>, options?: { | ||
authMode?: AuthMode; | ||
@@ -435,0 +435,0 @@ authToken?: string; |
{ | ||
"name": "@aws-amplify/data-schema-types", | ||
"version": "0.7.17", | ||
"version": "0.8.0", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "main": "./lib-esm/index.d.ts", |
@@ -279,4 +279,2 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
Fields, | ||
ModelMeta extends Record<any, any>, | ||
RelationalFields = ModelMeta['relationalInputFields'], | ||
WritableFields = Pick<Fields, WritableKeys<Fields>>, | ||
@@ -289,3 +287,3 @@ > = { | ||
: Prop]: WritableFields[Prop]; | ||
} & RelationalFields; | ||
}; | ||
@@ -300,5 +298,4 @@ /** | ||
Equal<ModelIdentifier<ModelMeta>, { id: string }> extends true | ||
? Partial<ModelIdentifier<ModelMeta>> & | ||
Omit<MutationInput<Model, ModelMeta>, 'id'> | ||
: MutationInput<Model, ModelMeta>; | ||
? Partial<ModelIdentifier<ModelMeta>> & Omit<MutationInput<Model>, 'id'> | ||
: MutationInput<Model>; | ||
@@ -500,5 +497,3 @@ // #endregion | ||
update: ( | ||
model: Prettify< | ||
ModelIdentifier<ModelMeta> & Partial<MutationInput<Model, ModelMeta>> | ||
>, | ||
model: Prettify<ModelIdentifier<ModelMeta> & Partial<MutationInput<Model>>>, | ||
options?: { | ||
@@ -607,5 +602,3 @@ authMode?: AuthMode; | ||
update: ( | ||
model: Prettify< | ||
ModelIdentifier<ModelMeta> & Partial<MutationInput<Model, ModelMeta>> | ||
>, | ||
model: Prettify<ModelIdentifier<ModelMeta> & Partial<MutationInput<Model>>>, | ||
options?: { | ||
@@ -670,5 +663,3 @@ authMode?: AuthMode; | ||
contextSpec: any, | ||
model: Prettify< | ||
ModelIdentifier<ModelMeta> & Partial<MutationInput<Model, ModelMeta>> | ||
>, | ||
model: Prettify<ModelIdentifier<ModelMeta> & Partial<MutationInput<Model>>>, | ||
options?: { | ||
@@ -675,0 +666,0 @@ authMode?: AuthMode; |
Sorry, the diff of this file is not supported yet
114655
1976