Skip to content

Instantly share code, notes, and snippets.

@daryllukas
Created August 19, 2020 11:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save daryllukas/3b7b80f216c4c1954097b6b4ca3770f8 to your computer and use it in GitHub Desktop.
Save daryllukas/3b7b80f216c4c1954097b6b4ca3770f8 to your computer and use it in GitHub Desktop.
type Job
@model
@auth(
rules: [
{ allow: groups, groups: ["Admin"], queries: [get, list], mutations: [update, delete] }
{ allow: public, queries: [get, list], mutations: [create] }
{ allow: private, operations: [read] }
]
) {
id: ID!
addresses: [Address] @connection(keyName: "byJob", fields: ["id"])
...
}
type Address
@model
@key(name: "byJob", fields: ["jobId", "addressLine1"])
@auth(
rules: [
{ allow: groups, groups: ["Admin"], queries: [get, list], mutations: [update, delete] }
{ allow: public, queries: [get, list], mutations: [create] }
{ allow: private, operations: [read], mutations: [create] }
]
) {
id: ID!
jobId: ID!
addressLine1: String!
addressLine2: String
createdAt: AWSDateTime
updatedAt: AWSDateTime
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment