Skip to content

Commit

Permalink
add deprecation notice to DataStore exported Schemaa type
Browse files Browse the repository at this point in the history
  • Loading branch information
svidgen committed Apr 30, 2024
1 parent 7ddca1b commit 3479e27
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/datastore/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,18 @@ import { GraphQLAuthMode } from '@aws-amplify/core/internals/utils';
export type Scalar<T> = T extends Array<infer InnerType> ? InnerType : T;

//#region Schema types
export type Schema = UserSchema & {
/**
* @deprecated If you intended to use the Schema for `generateClient`, then you've imported the wrong Schema type.
* Use `import { type Schema } from '../amplify/data/resource' instead. If you intended to import the type for DataStore
* Schemas, then import "DataStoreSchema" instead.
*/
export type Schema = DataStoreSchema;

export type DataStoreSchema = UserSchema & {
version: string;
codegenVersion: string;
};

export type UserSchema = {
models: SchemaModels;
nonModels?: SchemaNonModels;
Expand Down

0 comments on commit 3479e27

Please sign in to comment.