Commit 5e0bd514 authored by George Koltsov's avatar George Koltsov

Add award emoji to epics in GraphQL

  - Add award emoji connection to GraphQL API in
  order to use it in Bulk Import
parent 6d09f211
...@@ -1147,6 +1147,41 @@ type AwardEmojiAddPayload { ...@@ -1147,6 +1147,41 @@ type AwardEmojiAddPayload {
errors: [String!]! errors: [String!]!
} }
"""
The connection type for AwardEmoji.
"""
type AwardEmojiConnection {
"""
A list of edges.
"""
edges: [AwardEmojiEdge]
"""
A list of nodes.
"""
nodes: [AwardEmoji]
"""
Information to aid in pagination.
"""
pageInfo: PageInfo!
}
"""
An edge in a connection.
"""
type AwardEmojiEdge {
"""
A cursor for use in pagination.
"""
cursor: String!
"""
The item at the end of the edge.
"""
node: AwardEmoji
}
""" """
Autogenerated input type of AwardEmojiRemove Autogenerated input type of AwardEmojiRemove
""" """
...@@ -1540,6 +1575,31 @@ type BoardEpic implements CurrentUserTodos & Noteable { ...@@ -1540,6 +1575,31 @@ type BoardEpic implements CurrentUserTodos & Noteable {
""" """
author: User! author: User!
"""
A list of award emojis associated with the epic
"""
awardEmoji(
"""
Returns the elements in the list that come after the specified cursor.
"""
after: String
"""
Returns the elements in the list that come before the specified cursor.
"""
before: String
"""
Returns the first _n_ elements from the list.
"""
first: Int
"""
Returns the last _n_ elements from the list.
"""
last: Int
): AwardEmojiConnection
""" """
Children (sub-epics) of the epic Children (sub-epics) of the epic
""" """
...@@ -8233,6 +8293,31 @@ type Epic implements CurrentUserTodos & Noteable { ...@@ -8233,6 +8293,31 @@ type Epic implements CurrentUserTodos & Noteable {
""" """
author: User! author: User!
"""
A list of award emojis associated with the epic
"""
awardEmoji(
"""
Returns the elements in the list that come after the specified cursor.
"""
after: String
"""
Returns the elements in the list that come before the specified cursor.
"""
before: String
"""
Returns the first _n_ elements from the list.
"""
first: Int
"""
Returns the last _n_ elements from the list.
"""
last: Int
): AwardEmojiConnection
""" """
Children (sub-epics) of the epic Children (sub-epics) of the epic
""" """
......
...@@ -2875,6 +2875,118 @@ ...@@ -2875,6 +2875,118 @@
"enumValues": null, "enumValues": null,
"possibleTypes": null "possibleTypes": null
}, },
{
"kind": "OBJECT",
"name": "AwardEmojiConnection",
"description": "The connection type for AwardEmoji.",
"fields": [
{
"name": "edges",
"description": "A list of edges.",
"args": [
],
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "AwardEmojiEdge",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "nodes",
"description": "A list of nodes.",
"args": [
],
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "AwardEmoji",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "pageInfo",
"description": "Information to aid in pagination.",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "PageInfo",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
"interfaces": [
],
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "AwardEmojiEdge",
"description": "An edge in a connection.",
"fields": [
{
"name": "cursor",
"description": "A cursor for use in pagination.",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "node",
"description": "The item at the end of the edge.",
"args": [
],
"type": {
"kind": "OBJECT",
"name": "AwardEmoji",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
"interfaces": [
],
"enumValues": null,
"possibleTypes": null
},
{ {
"kind": "INPUT_OBJECT", "kind": "INPUT_OBJECT",
"name": "AwardEmojiRemoveInput", "name": "AwardEmojiRemoveInput",
...@@ -4001,6 +4113,59 @@ ...@@ -4001,6 +4113,59 @@
"isDeprecated": false, "isDeprecated": false,
"deprecationReason": null "deprecationReason": null
}, },
{
"name": "awardEmoji",
"description": "A list of award emojis associated with the epic",
"args": [
{
"name": "after",
"description": "Returns the elements in the list that come after the specified cursor.",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null
},
{
"name": "before",
"description": "Returns the elements in the list that come before the specified cursor.",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null
},
{
"name": "first",
"description": "Returns the first _n_ elements from the list.",
"type": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
},
"defaultValue": null
},
{
"name": "last",
"description": "Returns the last _n_ elements from the list.",
"type": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
},
"defaultValue": null
}
],
"type": {
"kind": "OBJECT",
"name": "AwardEmojiConnection",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{ {
"name": "children", "name": "children",
"description": "Children (sub-epics) of the epic", "description": "Children (sub-epics) of the epic",
...@@ -22845,6 +23010,59 @@ ...@@ -22845,6 +23010,59 @@
"isDeprecated": false, "isDeprecated": false,
"deprecationReason": null "deprecationReason": null
}, },
{
"name": "awardEmoji",
"description": "A list of award emojis associated with the epic",
"args": [
{
"name": "after",
"description": "Returns the elements in the list that come after the specified cursor.",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null
},
{
"name": "before",
"description": "Returns the elements in the list that come before the specified cursor.",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null
},
{
"name": "first",
"description": "Returns the first _n_ elements from the list.",
"type": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
},
"defaultValue": null
},
{
"name": "last",
"description": "Returns the last _n_ elements from the list.",
"type": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
},
"defaultValue": null
}
],
"type": {
"kind": "OBJECT",
"name": "AwardEmojiConnection",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{ {
"name": "children", "name": "children",
"description": "Children (sub-epics) of the epic", "description": "Children (sub-epics) of the epic",
...@@ -263,6 +263,7 @@ Represents an epic on an issue board. ...@@ -263,6 +263,7 @@ Represents an epic on an issue board.
| Field | Type | Description | | Field | Type | Description |
| ----- | ---- | ----------- | | ----- | ---- | ----------- |
| `author` | User! | Author of the epic | | `author` | User! | Author of the epic |
| `awardEmoji` | AwardEmojiConnection | A list of award emojis associated with the epic |
| `children` | EpicConnection | Children (sub-epics) of the epic | | `children` | EpicConnection | Children (sub-epics) of the epic |
| `closedAt` | Time | Timestamp of when the epic was closed | | `closedAt` | Time | Timestamp of when the epic was closed |
| `confidential` | Boolean | Indicates if the epic is confidential | | `confidential` | Boolean | Indicates if the epic is confidential |
...@@ -1359,6 +1360,7 @@ Represents an epic. ...@@ -1359,6 +1360,7 @@ Represents an epic.
| Field | Type | Description | | Field | Type | Description |
| ----- | ---- | ----------- | | ----- | ---- | ----------- |
| `author` | User! | Author of the epic | | `author` | User! | Author of the epic |
| `awardEmoji` | AwardEmojiConnection | A list of award emojis associated with the epic |
| `children` | EpicConnection | Children (sub-epics) of the epic | | `children` | EpicConnection | Children (sub-epics) of the epic |
| `closedAt` | Time | Timestamp of when the epic was closed | | `closedAt` | Time | Timestamp of when the epic was closed |
| `confidential` | Boolean | Indicates if the epic is confidential | | `confidential` | Boolean | Indicates if the epic is confidential |
......
...@@ -141,6 +141,11 @@ module Types ...@@ -141,6 +141,11 @@ module Types
field :health_status, Types::EpicHealthStatusType, null: true, complexity: 10, field :health_status, Types::EpicHealthStatusType, null: true, complexity: 10,
description: 'Current health status of the epic' description: 'Current health status of the epic'
field :award_emoji,
Types::AwardEmojis::AwardEmojiType.connection_type,
null: true,
description: 'A list of award emojis associated with the epic'
def has_children? def has_children?
Gitlab::Graphql::Aggregations::Epics::LazyEpicAggregate.new(context, object.id, COUNT) do |node, _aggregate_object| Gitlab::Graphql::Aggregations::Epics::LazyEpicAggregate.new(context, object.id, COUNT) do |node, _aggregate_object|
node.children.any? node.children.any?
......
---
title: Add award emoji to epics in GraphQL
merge_request: 52922
author:
type: added
...@@ -13,6 +13,7 @@ RSpec.describe GitlabSchema.types['Epic'] do ...@@ -13,6 +13,7 @@ RSpec.describe GitlabSchema.types['Epic'] do
notes discussions relative_position subscribed participants notes discussions relative_position subscribed participants
descendant_counts descendant_weight_sum upvotes downvotes descendant_counts descendant_weight_sum upvotes downvotes
user_notes_count user_discussions_count health_status current_user_todos user_notes_count user_discussions_count health_status current_user_todos
award_emoji
] ]
end end
...@@ -29,4 +30,6 @@ RSpec.describe GitlabSchema.types['Epic'] do ...@@ -29,4 +30,6 @@ RSpec.describe GitlabSchema.types['Epic'] do
it { expect(described_class).to have_graphql_field(:subscribed, complexity: 5) } it { expect(described_class).to have_graphql_field(:subscribed, complexity: 5) }
it { expect(described_class).to have_graphql_field(:participants, complexity: 5) } it { expect(described_class).to have_graphql_field(:participants, complexity: 5) }
it { expect(described_class).to have_graphql_field(:award_emoji) }
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