Skip to content

Commit

Permalink
update mosque schema
Browse files Browse the repository at this point in the history
  • Loading branch information
zxcvbnmmohd committed May 30, 2024
1 parent 24c21ba commit c4f70fd
Showing 1 changed file with 31 additions and 5 deletions.
36 changes: 31 additions & 5 deletions amplify/backend/api/RukuAPI/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,18 @@ type Mosque
{ allow: public, operations: [read] }
]
)
creatorID: ID! @index(name: "byCreator")
creator: User! @belongsTo(fields: ["creatorID"])
creatorID: ID! @index(name: "byCreator") @auth(
rules: [
{ allow: private, operations: [read] }
{ allow: public, operations: [read] }
]
)
creator: User! @belongsTo(fields: ["creatorID"]) @auth(
rules: [
{ allow: private, operations: [read] }
{ allow: public, operations: [read] }
]
)
organizationID: ID @index(name: "byOrganization")
organization: Organization @belongsTo(fields: ["organizationID"])
followers: [User]! @manyToMany(relationName: "MosqueFollower")
Expand All @@ -233,7 +243,12 @@ type Mosque
bookmarks: [Bookmark]! @hasMany(indexName: "byMosque", fields: ["id"])
likes: [Like]! @hasMany(indexName: "byMosque", fields: ["id"])
comments: [Comment]! @hasMany(indexName: "byMosque", fields: ["id"])
createdAt: AWSDateTime!
createdAt: AWSDateTime! @auth(
rules: [
{ allow: private, operations: [read] }
{ allow: public, operations: [read] }
]
)
updatedAt: AWSDateTime!
owners: [String] @auth(rules: [{ allow: owner }])
}
Expand All @@ -250,12 +265,23 @@ type Organization
id: ID!
name: String!
description: String
domain: String
logo: String
phone: AWSPhone
email: AWSEmail
website: String
isVerified: Boolean! @default(value: "false")
creatorID: ID! @index(name: "byCreator")
isVerified: Boolean! @default(value: "false") @auth(
rules: [
{ allow: private, operations: [read] }
{ allow: public, operations: [read] }
]
)
creatorID: ID! @index(name: "byCreator") @auth(
rules: [
{ allow: private, operations: [read] }
{ allow: public, operations: [read] }
]
)
creator: User! @belongsTo(fields: ["creatorID"])
members: [User]! @manyToMany(relationName: "OrganizationMember")
mosques: [Mosque]! @hasMany(indexName: "byOrganization", fields: ["id"])
Expand Down

0 comments on commit c4f70fd

Please sign in to comment.