Commit 06a0b404 authored by charlie ablett's avatar charlie ablett

Allow user to filter epics by reaction emoji

- backend only
parent 7c7d964b
---
title: Allow user to filter epics by their reaction emoji via GraphQL
merge_request: 58211
author:
type: added
...@@ -50,6 +50,10 @@ module Resolvers ...@@ -50,6 +50,10 @@ module Resolvers
required: false, required: false,
description: 'Filter epics by given confidentiality.' description: 'Filter epics by given confidentiality.'
argument :my_reaction_emoji, GraphQL::STRING_TYPE,
required: false,
description: 'Filter by reaction emoji applied by the current user.'
type Types::EpicType, null: true type Types::EpicType, null: true
def ready?(**args) def ready?(**args)
......
...@@ -134,6 +134,17 @@ RSpec.describe Resolvers::EpicsResolver do ...@@ -134,6 +134,17 @@ RSpec.describe Resolvers::EpicsResolver do
end end
end end
context 'with my_reaction_emoji' do
it 'filters epics by reaction emoji' do
create(:award_emoji, name: 'man_in_business_suit_levitating', user: current_user, awardable: epic1)
create(:award_emoji, name: 'thumbsdown', user: current_user, awardable: epic2)
epics = resolve_epics(my_reaction_emoji: 'man_in_business_suit_levitating')
expect(epics).to contain_exactly(epic1)
end
end
context 'with milestone_title' do context 'with milestone_title' do
let_it_be(:milestone1) { create(:milestone, group: group) } let_it_be(:milestone1) { create(:milestone, group: group) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment