diff --git a/backend/src/middleware/filterBubble/filterBubble.spec.js b/backend/src/middleware/filterBubble/filterBubble.spec.js index e18654868..afe1df1c9 100644 --- a/backend/src/middleware/filterBubble/filterBubble.spec.js +++ b/backend/src/middleware/filterBubble/filterBubble.spec.js @@ -65,7 +65,7 @@ describe('FilterBubble middleware', () => { describe('filtering for posts of followed users only', () => { it('returns only posts authored by followed users', async () => { - const query = '{ Post( filterBubble: { author: followed }) { title } }' + const query = '{ Post( filterBubble: { author: following }) { title } }' const expected = { Post: [{ title: 'This is the post of a followed user' }], } diff --git a/backend/src/middleware/filterBubble/replaceParams.js b/backend/src/middleware/filterBubble/replaceParams.js index 82d39d024..43877eb43 100644 --- a/backend/src/middleware/filterBubble/replaceParams.js +++ b/backend/src/middleware/filterBubble/replaceParams.js @@ -4,9 +4,9 @@ export default async function replaceParams(args, context) { const { author = 'all' } = args.filterBubble || {} const { user } = context - if (author === 'followed') { + if (author === 'following') { if (!user) - throw new UserInputError("You are unauthenticated - I don't know your followed users") + throw new UserInputError("You are unauthenticated - I don't know any users you are following.") const session = context.driver.session() let { records } = await session.run( diff --git a/backend/src/middleware/filterBubble/replaceParams.spec.js b/backend/src/middleware/filterBubble/replaceParams.spec.js index cd9e0a3da..5566e4a91 100644 --- a/backend/src/middleware/filterBubble/replaceParams.spec.js +++ b/backend/src/middleware/filterBubble/replaceParams.spec.js @@ -38,9 +38,9 @@ describe('replaceParams', () => { context.user = null }) - describe('{ filterBubble: { author: followed } }', () => { + describe('{ filterBubble: { author: following } }', () => { it('throws error', async () => { - args = { filterBubble: { author: 'followed' } } + args = { filterBubble: { author: 'following' } } await expect(action()).rejects.toThrow('You are unauthenticated') }) }) @@ -63,9 +63,9 @@ describe('replaceParams', () => { context.user = { id: 'u4711' } }) - describe('{ filterBubble: { author: followed } }', () => { + describe('{ filterBubble: { author: following } }', () => { beforeEach(() => { - args = { filterBubble: { author: 'followed' } } + args = { filterBubble: { author: 'following' } } }) it('returns args object with resolved ids of followed users', async () => { diff --git a/backend/src/schema/types/type/Post.gql b/backend/src/schema/types/type/Post.gql index e932bafbf..1179c3e20 100644 --- a/backend/src/schema/types/type/Post.gql +++ b/backend/src/schema/types/type/Post.gql @@ -1,5 +1,5 @@ enum FilterBubbleAuthorEnum { - followed + following all }