Last active
May 14, 2020 00:13
-
-
Save dabit3/c67778909722d64bb452de81c1895d4f to your computer and use it in GitHub Desktop.
Amplify GraphQL Schema with different access patterns
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Product @model | |
@key(name: "productInventoryAmountIndex", fields: ["baseType", "inventory"], queryField: "productsByInventoryAmount") | |
@key(name: "productInventoryPriceIndex", fields: ["baseType", "price"], queryField: "productsByPrice") | |
@key(name: "productNameSearchIndex", fields: ["baseType", "name"], queryField: "productSearchByName") | |
@key(name: "productCategorySearchIndex", fields: ["baseType", "category"], queryField: "productSearchByCategory") | |
@key(name: "productCategoryIndex", fields: ["category", "createdAt"], queryField: "productsByCategory") | |
@key(name: "productByCategoryAndNameIndex", fields: ["category", "name"], queryField: "productsByCategoryAndName") | |
@key(name: "productByCategoryAndInventoryIndex", fields: ["category", "inventory"], queryField: "productsByCategoryAndInventory") | |
@key(name: "productByCategoryAndPriceIndex", fields: ["category", "price"], queryField: "productsByCategoryAndPrice") | |
{ | |
id: ID | |
name: String | |
price: Float | |
category: String | |
inventory: Int | |
createdAt: String | |
baseType: String | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment