Commit bb93702a authored by Jarka Košanová's avatar Jarka Košanová

Merge branch '36309-graphql-refactor-epic-mutations-base' into 'master'

Refactor Epic mutations base

See merge request gitlab-org/gitlab!25991
parents 1674b4ed dac26146
......@@ -2609,12 +2609,12 @@ input EpicSetSubscriptionInput {
clientMutationId: String
"""
The group the epic to (un)subscribe is in
The group the epic to mutate is in
"""
groupPath: ID!
"""
The iid of the epic to (un)subscribe
The iid of the epic to mutate
"""
iid: ID!
......@@ -7820,7 +7820,7 @@ input UpdateEpicInput {
"""
The iid of the epic to mutate
"""
iid: String!
iid: ID!
"""
The IDs of labels to be removed from the epic.
......
......@@ -24409,6 +24409,20 @@
"description": "Autogenerated input type of UpdateEpic",
"fields": null,
"inputFields": [
{
"name": "iid",
"description": "The iid of the epic to mutate",
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
}
},
"defaultValue": null
},
{
"name": "groupPath",
"description": "The group the epic to mutate is in",
......@@ -24519,20 +24533,6 @@
},
"defaultValue": null
},
{
"name": "iid",
"description": "The iid of the epic to mutate",
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"defaultValue": null
},
{
"name": "stateEvent",
"description": "State event for the epic",
......@@ -24863,8 +24863,8 @@
"fields": null,
"inputFields": [
{
"name": "groupPath",
"description": "The group the epic to (un)subscribe is in",
"name": "iid",
"description": "The iid of the epic to mutate",
"type": {
"kind": "NON_NULL",
"name": null,
......@@ -24877,8 +24877,8 @@
"defaultValue": null
},
{
"name": "iid",
"description": "The iid of the epic to (un)subscribe",
"name": "groupPath",
"description": "The group the epic to mutate is in",
"type": {
"kind": "NON_NULL",
"name": null,
......
......@@ -5,6 +5,19 @@ module Mutations
class Base < ::Mutations::BaseMutation
include Mutations::ResolvesGroup
argument :iid, GraphQL::ID_TYPE,
required: true,
description: "The iid of the epic to mutate"
argument :group_path, GraphQL::ID_TYPE,
required: true,
description: 'The group the epic to mutate is in'
field :epic,
Types::EpicType,
null: true,
description: 'The epic after mutation'
private
def find_object(group_path:, iid:)
......
......@@ -7,23 +7,10 @@ module Mutations
authorize :read_epic
argument :group_path, GraphQL::ID_TYPE,
required: true,
description: 'The group the epic to (un)subscribe is in'
argument :iid, GraphQL::ID_TYPE,
required: true,
description: 'The iid of the epic to (un)subscribe'
argument :subscribed_state, GraphQL::BOOLEAN_TYPE,
required: true,
description: 'The desired state of the subscription'
field :epic,
Types::EpicType,
null: true,
description: 'The epic after mutation'
def resolve(args)
group_path = args.delete(:group_path)
epic_iid = args.delete(:iid)
......
......@@ -7,10 +7,6 @@ module Mutations
graphql_name 'UpdateEpic'
argument :iid, GraphQL::STRING_TYPE,
required: true,
description: "The iid of the epic to mutate"
argument :state_event,
Types::EpicStateEventEnum,
required: false,
......@@ -21,11 +17,6 @@ module Mutations
required: false,
description: 'The desired health status'
field :epic,
Types::EpicType,
null: true,
description: 'The epic after mutation'
authorize :admin_epic
def resolve(args)
......
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