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