Skip to content

Commit

Permalink
Forget to commit schema.graphql
Browse files Browse the repository at this point in the history
  • Loading branch information
MasaGon committed Oct 13, 2020
1 parent b834162 commit 2a5d0f3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
17 changes: 16 additions & 1 deletion amplify/backend/api/studyathome/schema.graphql
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
type School
@model
@auth(
rules: [
{ allow: private, operations: [create], provider: userPools }
{ allow: owner, operations: [read, update, delete], provider: userPools, ownerField: "owner" }
]
)
{
id: ID!
name: String!
owner: String!
}

type Class
@model
@auth(
Expand All @@ -9,8 +23,9 @@ type Class
)
{
id: ID!
schoolId: ID!
school: School! @connection(fields: ["schoolId"])
className: String!
schoolName: String!
lessons: [Lesson!] @connection(keyName: "byClass", fields: ["id"])
owner: String!
}
Expand Down
4 changes: 1 addition & 3 deletions src/store/modules/classData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,11 @@ export class ClassDataStore extends VuexModule implements classData.ClassData {
},
})
)
const sid = (school as any).data.createSchool.id
console.log(sid)
await API.graphql(
graphqlOperation(createClass, {
input: {
id: classId,
schoolId: sid,
schoolId: (school as any).data.createSchool.id,
className,
owner: user.username,
},
Expand Down

0 comments on commit 2a5d0f3

Please sign in to comment.