Skip to content

Instantly share code, notes, and snippets.

@ryo0301
Created January 6, 2020 02:41
Show Gist options
  • Save ryo0301/788e865c94db113b7c7786e8dacd93f6 to your computer and use it in GitHub Desktop.
Save ryo0301/788e865c94db113b7c7786e8dacd93f6 to your computer and use it in GitHub Desktop.
aws appsync graphql transfer @auth
type Building
@auth(
rules: [
{
allow: groups,
groups: ["Managers"],
queries: null,
mutations: [create, update, delete]
},
{
allow: groups,
groups: ["Users"],
queries: [get, list],
mutations: null
}
]
)
{
id: ID!
name: String!
address: String!
units: [Unit!]!
}
type Unit
@auth(
rules: [
{
allow: groups,
groups: ["Managers"],
queries: null,
mutations: [create, update, delete]
},
{
allow: groups,
groups: ["Users"],
queries: [get, list],
mutations: null
}
]
)
{
buildingid: ID!
unitid: String!
name: String!
building: Building!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment