TypeScript-first AWS AppSync Schema Builder
npm install @aws-amplify/amplify-api-next-alphaTypeScript-first AWS AppSync Schema Builder
``ts
import {
a,
type ClientSchema,
} from '@aws-amplify/amplify-api-next-alpha';
const schema = a.schema({
Post: a.model({
id: a.id(),
title: a.string(),
comments: a.hasMany('Comment'),
}),
Comment: a.model({
id: a.id(),
content: a.string(),
post: a.belongsTo('Post'),
}),
});
export type Schema = ClientSchema
export schema
``
See CONTRIBUTING for more information.
This project is licensed under the Apache-2.0 License.