Skip to content

Instantly share code, notes, and snippets.

@evankirkiles
Created March 7, 2022 14:03
Show Gist options
  • Save evankirkiles/b1bb7b633063fc13b7fe24a2aaff0035 to your computer and use it in GitHub Desktop.
Save evankirkiles/b1bb7b633063fc13b7fe24a2aaff0035 to your computer and use it in GitHub Desktop.
AWS Amplify: Sample Wardrobe Schema for Cascade Deletion
type Outfit
@model
@auth(rules: [{ allow: owner }]) {
components: [OutfitComponent!] @hasMany
}
type OutfitComponent
@model
@auth(rules: [{ allow: owner }]) {
clotheImage: ClotheImage! @belongsTo
}
type Clothe
@model
@auth(rules: [{ allow: owner }]) {
images: [ClotheImage!]! @hasMany
}
type ClotheImage
@model
@auth(rules: [{ allow: owner }]) {
components: [OutfitComponent] @hasMany
clothe: Clothe! @belongsTo
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment