Commit 318a49b4 authored by Felipe Artur's avatar Felipe Artur

Rename NoteableType to NoteableInterface

parent 25613d74
...@@ -8,7 +8,7 @@ module Types ...@@ -8,7 +8,7 @@ module Types
present_using ::AlertManagement::AlertPresenter present_using ::AlertManagement::AlertPresenter
implements(Types::Notes::NoteableType) implements(Types::Notes::NoteableInterface)
authorize :read_alert_management_alert authorize :read_alert_management_alert
......
...@@ -10,7 +10,7 @@ module Types ...@@ -10,7 +10,7 @@ module Types
alias_method :design, :object alias_method :design, :object
implements(Types::Notes::NoteableType) implements(Types::Notes::NoteableInterface)
implements(Types::DesignManagement::DesignFields) implements(Types::DesignManagement::DesignFields)
implements(Types::CurrentUserTodos) implements(Types::CurrentUserTodos)
......
...@@ -6,7 +6,7 @@ module Types ...@@ -6,7 +6,7 @@ module Types
connection_type_class(Types::IssueConnectionType) connection_type_class(Types::IssueConnectionType)
implements(Types::Notes::NoteableType) implements(Types::Notes::NoteableInterface)
implements(Types::CurrentUserTodos) implements(Types::CurrentUserTodos)
authorize :read_issue authorize :read_issue
......
...@@ -6,7 +6,7 @@ module Types ...@@ -6,7 +6,7 @@ module Types
connection_type_class(Types::MergeRequestConnectionType) connection_type_class(Types::MergeRequestConnectionType)
implements(Types::Notes::NoteableType) implements(Types::Notes::NoteableInterface)
implements(Types::CurrentUserTodos) implements(Types::CurrentUserTodos)
authorize :read_merge_request authorize :read_merge_request
......
# frozen_string_literal: true # frozen_string_literal: true
module Types module Types
class NoteableUnion < BaseUnion class NoteableType < BaseUnion
graphql_name 'NoteableUnion' graphql_name 'NoteableType'
description 'Represents an object that supports notes.' description 'Represents an object that supports notes.'
possible_types Types::IssueType, Types::DesignManagement::DesignType, Types::MergeRequestType possible_types Types::IssueType, Types::DesignManagement::DesignType, Types::MergeRequestType
......
...@@ -19,7 +19,7 @@ module Types ...@@ -19,7 +19,7 @@ module Types
description: "Timestamp of the discussion's creation." description: "Timestamp of the discussion's creation."
field :notes, Types::Notes::NoteType.connection_type, null: false, field :notes, Types::Notes::NoteType.connection_type, null: false,
description: 'All notes in the discussion.' description: 'All notes in the discussion.'
field :noteable, Types::NoteableUnion, null: true, field :noteable, Types::NoteableType, null: true,
description: 'Object which the discussion belongs to.' description: 'Object which the discussion belongs to.'
# DiscussionID.coerce_result is suitable here, but will always mark this # DiscussionID.coerce_result is suitable here, but will always mark this
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module Types module Types
module Notes module Notes
module NoteableType module NoteableInterface
include Types::BaseInterface include Types::BaseInterface
field :notes, Types::Notes::NoteType.connection_type, null: false, description: "All notes on this noteable." field :notes, Types::Notes::NoteType.connection_type, null: false, description: "All notes on this noteable."
...@@ -28,4 +28,4 @@ module Types ...@@ -28,4 +28,4 @@ module Types
end end
end end
Types::Notes::NoteableType.prepend_mod_with('Types::Notes::NoteableType') Types::Notes::NoteableInterface.prepend_mod_with('Types::Notes::NoteableInterface')
...@@ -5,7 +5,7 @@ module Types ...@@ -5,7 +5,7 @@ module Types
graphql_name 'Snippet' graphql_name 'Snippet'
description 'Represents a snippet entry' description 'Represents a snippet entry'
implements(Types::Notes::NoteableType) implements(Types::Notes::NoteableInterface)
present_using SnippetPresenter present_using SnippetPresenter
......
...@@ -8433,6 +8433,7 @@ Aggregated summary of changes. ...@@ -8433,6 +8433,7 @@ Aggregated summary of changes.
| ---- | ---- | ----------- | | ---- | ---- | ----------- |
| <a id="discussioncreatedat"></a>`createdAt` | [`Time!`](#time) | Timestamp of the discussion's creation. | | <a id="discussioncreatedat"></a>`createdAt` | [`Time!`](#time) | Timestamp of the discussion's creation. |
| <a id="discussionid"></a>`id` | [`DiscussionID!`](#discussionid) | ID of this discussion. | | <a id="discussionid"></a>`id` | [`DiscussionID!`](#discussionid) | ID of this discussion. |
| <a id="discussionnoteable"></a>`noteable` | [`NoteableType`](#noteabletype) | Object which the discussion belongs to. |
| <a id="discussionnotes"></a>`notes` | [`NoteConnection!`](#noteconnection) | All notes in the discussion. (see [Connections](#connections)) | | <a id="discussionnotes"></a>`notes` | [`NoteConnection!`](#noteconnection) | All notes in the discussion. (see [Connections](#connections)) |
| <a id="discussionreplyid"></a>`replyId` | [`DiscussionID!`](#discussionid) | ID used to reply to this discussion. | | <a id="discussionreplyid"></a>`replyId` | [`DiscussionID!`](#discussionid) | ID used to reply to this discussion. |
| <a id="discussionresolvable"></a>`resolvable` | [`Boolean!`](#boolean) | Indicates if the object can be resolved. | | <a id="discussionresolvable"></a>`resolvable` | [`Boolean!`](#boolean) | Indicates if the object can be resolved. |
...@@ -15630,6 +15631,16 @@ One of: ...@@ -15630,6 +15631,16 @@ One of:
- [`Issue`](#issue) - [`Issue`](#issue)
- [`MergeRequest`](#mergerequest) - [`MergeRequest`](#mergerequest)
#### `NoteableType`
Represents an object that supports notes.
One of:
- [`Design`](#design)
- [`Issue`](#issue)
- [`MergeRequest`](#mergerequest)
#### `PackageMetadata` #### `PackageMetadata`
Represents metadata associated with a Package. Represents metadata associated with a Package.
...@@ -15798,7 +15809,7 @@ Implementations: ...@@ -15798,7 +15809,7 @@ Implementations:
| <a id="memberinterfaceupdatedat"></a>`updatedAt` | [`Time`](#time) | Date and time the membership was last updated. | | <a id="memberinterfaceupdatedat"></a>`updatedAt` | [`Time`](#time) | Date and time the membership was last updated. |
| <a id="memberinterfaceuser"></a>`user` | [`UserCore`](#usercore) | User that is associated with the member object. | | <a id="memberinterfaceuser"></a>`user` | [`UserCore`](#usercore) | User that is associated with the member object. |
#### `Noteable` #### `NoteableInterface`
Implementations: Implementations:
...@@ -15816,8 +15827,8 @@ Implementations: ...@@ -15816,8 +15827,8 @@ Implementations:
| Name | Type | Description | | Name | Type | Description |
| ---- | ---- | ----------- | | ---- | ---- | ----------- |
| <a id="noteablediscussions"></a>`discussions` | [`DiscussionConnection!`](#discussionconnection) | All discussions on this noteable. (see [Connections](#connections)) | | <a id="noteableinterfacediscussions"></a>`discussions` | [`DiscussionConnection!`](#discussionconnection) | All discussions on this noteable. (see [Connections](#connections)) |
| <a id="noteablenotes"></a>`notes` | [`NoteConnection!`](#noteconnection) | All notes on this noteable. (see [Connections](#connections)) | | <a id="noteableinterfacenotes"></a>`notes` | [`NoteConnection!`](#noteconnection) | All notes on this noteable. (see [Connections](#connections)) |
#### `PackageFileMetadata` #### `PackageFileMetadata`
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module EE module EE
module Types module Types
module Notes module Notes
module NoteableType module NoteableInterface
module ClassMethods module ClassMethods
def resolve_type(object, *) def resolve_type(object, *)
return ::Types::VulnerabilityType if ::Vulnerability === object return ::Types::VulnerabilityType if ::Vulnerability === object
......
...@@ -13,7 +13,7 @@ module Types ...@@ -13,7 +13,7 @@ module Types
present_using EpicPresenter present_using EpicPresenter
implements(Types::Notes::NoteableType) implements(Types::Notes::NoteableInterface)
implements(Types::CurrentUserTodos) implements(Types::CurrentUserTodos)
implements(Types::EventableType) implements(Types::EventableType)
......
...@@ -5,7 +5,7 @@ module Types ...@@ -5,7 +5,7 @@ module Types
graphql_name 'Vulnerability' graphql_name 'Vulnerability'
description 'Represents a vulnerability' description 'Represents a vulnerability'
implements(Types::Notes::NoteableType) implements(Types::Notes::NoteableInterface)
authorize :read_security_resource authorize :read_security_resource
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe EE::Types::Notes::NoteableType do RSpec.describe EE::Types::Notes::NoteableInterface do
let(:extended_class) { Types::Notes::NoteableType } let(:extended_class) { Types::Notes::NoteableInterface }
describe ".resolve_type" do describe ".resolve_type" do
it 'knows the correct type for objects' do it 'knows the correct type for objects' do
......
...@@ -9,7 +9,7 @@ RSpec.describe GitlabSchema.types['Issue'] do ...@@ -9,7 +9,7 @@ RSpec.describe GitlabSchema.types['Issue'] do
specify { expect(described_class).to require_graphql_authorizations(:read_issue) } specify { expect(described_class).to require_graphql_authorizations(:read_issue) }
specify { expect(described_class.interfaces).to include(Types::Notes::NoteableType) } specify { expect(described_class.interfaces).to include(Types::Notes::NoteableInterface) }
specify { expect(described_class.interfaces).to include(Types::CurrentUserTodos) } specify { expect(described_class.interfaces).to include(Types::CurrentUserTodos) }
......
...@@ -9,7 +9,7 @@ RSpec.describe GitlabSchema.types['MergeRequest'] do ...@@ -9,7 +9,7 @@ RSpec.describe GitlabSchema.types['MergeRequest'] do
specify { expect(described_class).to require_graphql_authorizations(:read_merge_request) } specify { expect(described_class).to require_graphql_authorizations(:read_merge_request) }
specify { expect(described_class.interfaces).to include(Types::Notes::NoteableType) } specify { expect(described_class.interfaces).to include(Types::Notes::NoteableInterface) }
specify { expect(described_class.interfaces).to include(Types::CurrentUserTodos) } specify { expect(described_class.interfaces).to include(Types::CurrentUserTodos) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe Types::Notes::NoteableType do RSpec.describe Types::Notes::NoteableInterface do
it 'exposes the expected fields' do it 'exposes the expected fields' do
expected_fields = %i[ expected_fields = %i[
discussions discussions
......
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