Open omarathon opened 3 years ago
The code here could be a solution to this problem.
type User
@model
@auth(rules: [{ allow: owner, ownerField: "id", queries: null }]) {
id: ID!
username: String!
conversations: [ConvoLink] @connection(name: "UserLinks")
messages: [Message] @connection(name: "UserMessages")
createdAt: String
updatedAt: String
}
Here's a step by step explanation of how this would work:
After some more research, I think we are better of just having a lambda function that will add a row to our DB (model called something like UserProfile
) that will trigger on the Cognito after authentication/confirmation. This lambda function should also check if the user profile already exists first to avoid creating duplicates or removing old rows.
The UserProfile should store anything that we want to use in the platform e.g.: | Attributes |
---|---|
Name | |
Username / Email | |
Credits / Coins | |
Position (member/exec) |
Specifically, how to get users into Amplify (current idea is table User in Amplify with trigger in Congito which adds them to the table), how to get them to the front-end (via GraphQL)