diff options
Diffstat (limited to 'app/graphql/types/boards')
5 files changed, 55 insertions, 18 deletions
diff --git a/app/graphql/types/boards/assignee_wildcard_id_enum.rb b/app/graphql/types/boards/assignee_wildcard_id_enum.rb new file mode 100644 index 00000000000..ba9058a78d9 --- /dev/null +++ b/app/graphql/types/boards/assignee_wildcard_id_enum.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Types + module Boards + class AssigneeWildcardIdEnum < BaseEnum + graphql_name 'AssigneeWildcardId' + description 'Assignee ID wildcard values' + + value 'NONE', 'No assignee is assigned.' + value 'ANY', 'An assignee is assigned.' + end + end +end diff --git a/app/graphql/types/boards/board_issuable_input_base_type.rb b/app/graphql/types/boards/board_issuable_input_base_type.rb new file mode 100644 index 00000000000..2cd057347d6 --- /dev/null +++ b/app/graphql/types/boards/board_issuable_input_base_type.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Types + module Boards + # Common arguments that we can be used to filter boards epics and issues + class BoardIssuableInputBaseType < BaseInputObject + argument :label_name, [GraphQL::STRING_TYPE, null: true], + required: false, + description: 'Filter by label name.' + + argument :author_username, GraphQL::STRING_TYPE, + required: false, + description: 'Filter by author username.' + + argument :my_reaction_emoji, GraphQL::STRING_TYPE, + required: false, + description: 'Filter by reaction emoji applied by the current user.' + end + end +end diff --git a/app/graphql/types/boards/board_issue_input_base_type.rb b/app/graphql/types/boards/board_issue_input_base_type.rb index b762cef6e58..7cf2dcb9c82 100644 --- a/app/graphql/types/boards/board_issue_input_base_type.rb +++ b/app/graphql/types/boards/board_issue_input_base_type.rb @@ -2,30 +2,19 @@ module Types module Boards - class BoardIssueInputBaseType < BaseInputObject - argument :label_name, GraphQL::STRING_TYPE.to_list_type, - required: false, - description: 'Filter by label name.' - + # rubocop: disable Graphql/AuthorizeTypes + class BoardIssueInputBaseType < BoardIssuableInputBaseType argument :milestone_title, GraphQL::STRING_TYPE, required: false, description: 'Filter by milestone title.' - argument :assignee_username, GraphQL::STRING_TYPE.to_list_type, + argument :assignee_username, [GraphQL::STRING_TYPE, null: true], required: false, description: 'Filter by assignee username.' - argument :author_username, GraphQL::STRING_TYPE, - required: false, - description: 'Filter by author username.' - argument :release_tag, GraphQL::STRING_TYPE, required: false, description: 'Filter by release tag.' - - argument :my_reaction_emoji, GraphQL::STRING_TYPE, - required: false, - description: 'Filter by reaction emoji.' end end end diff --git a/app/graphql/types/boards/board_issue_input_type.rb b/app/graphql/types/boards/board_issue_input_type.rb index 9cc0f484a16..8c0e37e5cb7 100644 --- a/app/graphql/types/boards/board_issue_input_type.rb +++ b/app/graphql/types/boards/board_issue_input_type.rb @@ -2,19 +2,24 @@ module Types module Boards - class NegatedBoardIssueInputType < BoardIssueInputBaseType - end - class BoardIssueInputType < BoardIssueInputBaseType graphql_name 'BoardIssueInput' argument :not, NegatedBoardIssueInputType, required: false, - description: 'List of negated params. Warning: this argument is experimental and a subject to change in future.' + prepare: ->(negated_args, ctx) { negated_args.to_h }, + description: <<~MD + List of negated arguments. + Warning: this argument is experimental and a subject to change in future. + MD argument :search, GraphQL::STRING_TYPE, required: false, description: 'Search query for issue title or description.' + + argument :assignee_wildcard_id, ::Types::Boards::AssigneeWildcardIdEnum, + required: false, + description: 'Filter by assignee wildcard. Incompatible with assigneeUsername.' end end end diff --git a/app/graphql/types/boards/negated_board_issue_input_type.rb b/app/graphql/types/boards/negated_board_issue_input_type.rb new file mode 100644 index 00000000000..a0fab2ae969 --- /dev/null +++ b/app/graphql/types/boards/negated_board_issue_input_type.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Types + module Boards + class NegatedBoardIssueInputType < BoardIssueInputBaseType + end + end +end + +Types::Boards::NegatedBoardIssueInputType.prepend_if_ee('::EE::Types::Boards::NegatedBoardIssueInputType') |