AWS Amplify Datastore - How to Create Account > Users Authorization Rules in Schema?

Viewed 176

Let say I have the following schema.graphql:

type Account @model {
  id: ID!
  title: String!
  users: [User] @connection(name: "AccountUsers")
}

type User @model {
  id: ID!
  name: String!
  account: Account @connection(name: "AccountUsers")
}

The goal is to allow each User from the Account to have access to this Account entity and to the other users from that Account using Amazon Cognito User Pools.

For example, I have a Settings screen where I'd like to show the account title and the list of users from your account.

Pretty common case, I assume, but didn't find much information... Thanks in advance for any help!

0 Answers
Related