Commit bba4bb73 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'bw-refactor-move-type-enum' into 'master'

Refactor MoveTypeEnum into a class

See merge request gitlab-org/gitlab!26189
parents 597c0d5c 4ed338f6
...@@ -4831,16 +4831,16 @@ enum MilestoneStateEnum { ...@@ -4831,16 +4831,16 @@ enum MilestoneStateEnum {
} }
""" """
The position the adjacent object should be moved. The position to which the adjacent object should be moved
""" """
enum MoveType { enum MoveType {
""" """
The adjacent object will be moved after the object that is being moved. The adjacent object will be moved after the object that is being moved
""" """
after after
""" """
The adjacent object will be moved before the object that is being moved. The adjacent object will be moved before the object that is being moved
""" """
before before
} }
......
...@@ -24550,20 +24550,20 @@ ...@@ -24550,20 +24550,20 @@
{ {
"kind": "ENUM", "kind": "ENUM",
"name": "MoveType", "name": "MoveType",
"description": "The position the adjacent object should be moved.", "description": "The position to which the adjacent object should be moved",
"fields": null, "fields": null,
"inputFields": null, "inputFields": null,
"interfaces": null, "interfaces": null,
"enumValues": [ "enumValues": [
{ {
"name": "before", "name": "before",
"description": "The adjacent object will be moved before the object that is being moved.", "description": "The adjacent object will be moved before the object that is being moved",
"isDeprecated": false, "isDeprecated": false,
"deprecationReason": null "deprecationReason": null
}, },
{ {
"name": "after", "name": "after",
"description": "The adjacent object will be moved after the object that is being moved.", "description": "The adjacent object will be moved after the object that is being moved",
"isDeprecated": false, "isDeprecated": false,
"deprecationReason": null "deprecationReason": null
} }
......
...@@ -7,13 +7,6 @@ module Types ...@@ -7,13 +7,6 @@ module Types
graphql_name 'EpicTreeNodeFieldsInputType' graphql_name 'EpicTreeNodeFieldsInputType'
description 'A node of an epic tree.' description 'A node of an epic tree.'
MoveTypeEnum = GraphQL::EnumType.define do
name 'MoveType'
description 'The position the adjacent object should be moved.'
value('before', 'The adjacent object will be moved before the object that is being moved.')
value('after', 'The adjacent object will be moved after the object that is being moved.')
end
argument :id, argument :id,
GraphQL::ID_TYPE, GraphQL::ID_TYPE,
required: true, required: true,
......
# frozen_string_literal: true
module Types
class MoveTypeEnum < BaseEnum
graphql_name 'MoveType'
description 'The position to which the adjacent object should be moved'
value 'before', 'The adjacent object will be moved before the object that is being moved'
value 'after', 'The adjacent object will be moved after the object that is being moved'
end
end
# frozen_string_literal: true
require 'spec_helper'
describe GitlabSchema.types['MoveType'] do
it { expect(described_class.graphql_name).to eq('MoveType') }
it 'exposes all the existing move values' do
expect(described_class.values.keys).to include(*%w[before after])
end
end
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