diff --git a/src/resolvers/posts.spec.js b/src/resolvers/posts.spec.js index 5603683eb..1601e3348 100644 --- a/src/resolvers/posts.spec.js +++ b/src/resolvers/posts.spec.js @@ -200,3 +200,49 @@ describe('DeletePost', () => { }) }) }) + +describe('AddPostDisabledBy', () => { + const mutation = ` + mutation { + AddPostDisabledBy(from: { id: "u8" }, to: { id: "p9" }) { + from { + id + } + to { + id + } + } + } + ` + it.todo('throws authorization error') + + describe('authenticated', () => { + it.todo('throws authorization error') + + describe('as moderator', () => { + it.todo('throws authorization error') + + describe('current user matches provided user', () => { + it.todo('sets current user') + it.todo('updates .disabled on post') + }) + }) + }) +}) + +describe('RemovePostDisabledBy', () => { + it.todo('throws authorization error') + + describe('authenticated', () => { + it.todo('throws authorization error') + + describe('as moderator', () => { + it.todo('throws authorization error') + + describe('current user matches provided user', () => { + it.todo('sets current user') + it.todo('updates .disabled on post') + }) + }) + }) +}) diff --git a/src/schema.graphql b/src/schema.graphql index 1f9bcb477..4c2a58505 100644 --- a/src/schema.graphql +++ b/src/schema.graphql @@ -133,6 +133,7 @@ type Post { visibility: VisibilityEnum deleted: Boolean disabled: Boolean + disabledBy: User! @relation(name: "DISABLED", direction: "IN") createdAt: String updatedAt: String