Commit 4ed338f6 authored by Brett Walker's avatar Brett Walker

Refactor MoveTypeEnum into a class

since grpahql 1.10.x no longer supports using
`#define`
parent 70c6bb4c
......@@ -4751,16 +4751,16 @@ enum MilestoneStateEnum {
}
"""
The position the adjacent object should be moved.
The position to which the adjacent object should be moved
"""
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
"""
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
}
......
......@@ -24316,20 +24316,20 @@
{
"kind": "ENUM",
"name": "MoveType",
"description": "The position the adjacent object should be moved.",
"description": "The position to which the adjacent object should be moved",
"fields": null,
"inputFields": null,
"interfaces": null,
"enumValues": [
{
"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,
"deprecationReason": null
},
{
"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,
"deprecationReason": null
}
......
......@@ -7,13 +7,6 @@ module Types
graphql_name 'EpicTreeNodeFieldsInputType'
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,
GraphQL::ID_TYPE,
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