Commit be05bfda authored by Mikołaj Wawrzyniak's avatar Mikołaj Wawrzyniak

Merge branch '292426-fix-graphql-descriptions-rubocop-offenses-6' into 'master'

Fix half of the Graphql/Descriptions FOSS types offenses [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!53172
parents 7d5e974b 3145877c
......@@ -717,61 +717,6 @@ RSpec/TimecopTravel:
Graphql/Descriptions:
Exclude:
- 'app/graphql/types/invitation_interface.rb'
- 'app/graphql/types/issue_type.rb'
- 'app/graphql/types/jira_import_type.rb'
- 'app/graphql/types/jira_user_type.rb'
- 'app/graphql/types/jira_users_mapping_input_type.rb'
- 'app/graphql/types/label_type.rb'
- 'app/graphql/types/member_interface.rb'
- 'app/graphql/types/merge_request_connection_type.rb'
- 'app/graphql/types/merge_request_type.rb'
- 'app/graphql/types/metadata_type.rb'
- 'app/graphql/types/metrics/dashboard_type.rb'
- 'app/graphql/types/metrics/dashboards/annotation_type.rb'
- 'app/graphql/types/milestone_stats_type.rb'
- 'app/graphql/types/milestone_type.rb'
- 'app/graphql/types/namespace_type.rb'
- 'app/graphql/types/notes/diff_position_type.rb'
- 'app/graphql/types/notes/discussion_type.rb'
- 'app/graphql/types/notes/note_type.rb'
- 'app/graphql/types/notes/noteable_type.rb'
- 'app/graphql/types/package_type.rb'
- 'app/graphql/types/project_invitation_type.rb'
- 'app/graphql/types/project_member_type.rb'
- 'app/graphql/types/project_statistics_type.rb'
- 'app/graphql/types/project_type.rb'
- 'app/graphql/types/projects/service_type.rb'
- 'app/graphql/types/projects/services/jira_project_type.rb'
- 'app/graphql/types/projects/services/jira_service_type.rb'
- 'app/graphql/types/prometheus_alert_type.rb'
- 'app/graphql/types/query_type.rb'
- 'app/graphql/types/range_input_type.rb'
- 'app/graphql/types/release_asset_link_input_type.rb'
- 'app/graphql/types/release_asset_link_type.rb'
- 'app/graphql/types/release_assets_input_type.rb'
- 'app/graphql/types/release_assets_type.rb'
- 'app/graphql/types/release_links_type.rb'
- 'app/graphql/types/release_source_type.rb'
- 'app/graphql/types/release_type.rb'
- 'app/graphql/types/repository_type.rb'
- 'app/graphql/types/resolvable_interface.rb'
- 'app/graphql/types/root_storage_statistics_type.rb'
- 'app/graphql/types/snippet_type.rb'
- 'app/graphql/types/snippets/blob_action_input_type.rb'
- 'app/graphql/types/snippets/blob_type.rb'
- 'app/graphql/types/snippets/blob_viewer_type.rb'
- 'app/graphql/types/task_completion_status.rb'
- 'app/graphql/types/terraform/state_type.rb'
- 'app/graphql/types/terraform/state_version_type.rb'
- 'app/graphql/types/todo_type.rb'
- 'app/graphql/types/tree/blob_type.rb'
- 'app/graphql/types/tree/entry_type.rb'
- 'app/graphql/types/tree/submodule_type.rb'
- 'app/graphql/types/tree/tree_entry_type.rb'
- 'app/graphql/types/tree/tree_type.rb'
- 'app/graphql/types/user_status_type.rb'
- 'app/graphql/types/user_type.rb'
- 'ee/app/graphql/ee/types/board_list_type.rb'
- 'ee/app/graphql/ee/types/board_type.rb'
- 'ee/app/graphql/ee/types/boards/board_issue_input_base_type.rb'
......
......@@ -5,25 +5,25 @@ module Types
include BaseInterface
field :email, GraphQL::STRING_TYPE, null: false,
description: 'Email of the member to invite'
description: 'Email of the member to invite.'
field :access_level, Types::AccessLevelType, null: true,
description: 'GitLab::Access level'
description: 'GitLab::Access level.'
field :created_by, Types::UserType, null: true,
description: 'User that authorized membership'
description: 'User that authorized membership.'
field :created_at, Types::TimeType, null: true,
description: 'Date and time the membership was created'
description: 'Date and time the membership was created.'
field :updated_at, Types::TimeType, null: true,
description: 'Date and time the membership was last updated'
description: 'Date and time the membership was last updated.'
field :expires_at, Types::TimeType, null: true,
description: 'Date and time the membership expires'
description: 'Date and time the membership expires.'
field :user, Types::UserType, null: true,
description: 'User that is associated with the member object'
description: 'User that is associated with the member object.'
definition_methods do
def resolve_type(object, context)
......
......@@ -16,113 +16,113 @@ module Types
present_using IssuePresenter
field :id, GraphQL::ID_TYPE, null: false,
description: "ID of the issue"
description: "ID of the issue."
field :iid, GraphQL::ID_TYPE, null: false,
description: "Internal ID of the issue"
description: "Internal ID of the issue."
field :title, GraphQL::STRING_TYPE, null: false,
description: 'Title of the issue'
description: 'Title of the issue.'
markdown_field :title_html, null: true
field :description, GraphQL::STRING_TYPE, null: true,
description: 'Description of the issue'
description: 'Description of the issue.'
markdown_field :description_html, null: true
field :state, IssueStateEnum, null: false,
description: 'State of the issue'
description: 'State of the issue.'
field :reference, GraphQL::STRING_TYPE, null: false,
description: 'Internal reference of the issue. Returned in shortened format by default',
description: 'Internal reference of the issue. Returned in shortened format by default.',
method: :to_reference do
argument :full, GraphQL::BOOLEAN_TYPE, required: false, default_value: false,
description: 'Boolean option specifying whether the reference should be returned in full'
description: 'Boolean option specifying whether the reference should be returned in full.'
end
field :author, Types::UserType, null: false,
description: 'User that created the issue'
description: 'User that created the issue.'
field :assignees, Types::UserType.connection_type, null: true,
description: 'Assignees of the issue'
description: 'Assignees of the issue.'
field :updated_by, Types::UserType, null: true,
description: 'User that last updated the issue'
description: 'User that last updated the issue.'
field :labels, Types::LabelType.connection_type, null: true,
description: 'Labels of the issue'
description: 'Labels of the issue.'
field :milestone, Types::MilestoneType, null: true,
description: 'Milestone of the issue'
description: 'Milestone of the issue.'
field :due_date, Types::TimeType, null: true,
description: 'Due date of the issue'
description: 'Due date of the issue.'
field :confidential, GraphQL::BOOLEAN_TYPE, null: false,
description: 'Indicates the issue is confidential'
description: 'Indicates the issue is confidential.'
field :discussion_locked, GraphQL::BOOLEAN_TYPE, null: false,
description: 'Indicates discussion is locked on the issue'
description: 'Indicates discussion is locked on the issue.'
field :upvotes, GraphQL::INT_TYPE, null: false,
description: 'Number of upvotes the issue has received'
description: 'Number of upvotes the issue has received.'
field :downvotes, GraphQL::INT_TYPE, null: false,
description: 'Number of downvotes the issue has received'
description: 'Number of downvotes the issue has received.'
field :user_notes_count, GraphQL::INT_TYPE, null: false,
description: 'Number of user notes of the issue',
description: 'Number of user notes of the issue.',
resolver: Resolvers::UserNotesCountResolver
field :user_discussions_count, GraphQL::INT_TYPE, null: false,
description: 'Number of user discussions in the issue',
description: 'Number of user discussions in the issue.',
resolver: Resolvers::UserDiscussionsCountResolver
field :web_path, GraphQL::STRING_TYPE, null: false, method: :issue_path,
description: 'Web path of the issue'
description: 'Web path of the issue.'
field :web_url, GraphQL::STRING_TYPE, null: false,
description: 'Web URL of the issue'
description: 'Web URL of the issue.'
field :relative_position, GraphQL::INT_TYPE, null: true,
description: 'Relative position of the issue (used for positioning in epic tree and issue boards)'
description: 'Relative position of the issue (used for positioning in epic tree and issue boards).'
field :participants, Types::UserType.connection_type, null: true, complexity: 5,
description: 'List of participants in the issue'
description: 'List of participants in the issue.'
field :emails_disabled, GraphQL::BOOLEAN_TYPE, null: false,
method: :project_emails_disabled?,
description: 'Indicates if a project has email notifications disabled: `true` if email notifications are disabled'
description: 'Indicates if a project has email notifications disabled: `true` if email notifications are disabled.'
field :subscribed, GraphQL::BOOLEAN_TYPE, method: :subscribed?, null: false, complexity: 5,
description: 'Indicates the currently logged in user is subscribed to the issue'
description: 'Indicates the currently logged in user is subscribed to the issue.'
field :time_estimate, GraphQL::INT_TYPE, null: false,
description: 'Time estimate of the issue'
description: 'Time estimate of the issue.'
field :total_time_spent, GraphQL::INT_TYPE, null: false,
description: 'Total time reported as spent on the issue'
description: 'Total time reported as spent on the issue.'
field :human_time_estimate, GraphQL::STRING_TYPE, null: true,
description: 'Human-readable time estimate of the issue'
description: 'Human-readable time estimate of the issue.'
field :human_total_time_spent, GraphQL::STRING_TYPE, null: true,
description: 'Human-readable total time reported as spent on the issue'
description: 'Human-readable total time reported as spent on the issue.'
field :closed_at, Types::TimeType, null: true,
description: 'Timestamp of when the issue was closed'
description: 'Timestamp of when the issue was closed.'
field :created_at, Types::TimeType, null: false,
description: 'Timestamp of when the issue was created'
description: 'Timestamp of when the issue was created.'
field :updated_at, Types::TimeType, null: false,
description: 'Timestamp of when the issue was last updated'
description: 'Timestamp of when the issue was last updated.'
field :task_completion_status, Types::TaskCompletionStatus, null: false,
description: 'Task completion status of the issue'
description: 'Task completion status of the issue.'
field :design_collection, Types::DesignManagement::DesignCollectionType, null: true,
description: 'Collection of design images associated with this issue'
description: 'Collection of design images associated with this issue.'
field :type, Types::IssueTypeEnum, null: true,
method: :issue_type,
description: 'Type of the issue'
description: 'Type of the issue.'
field :alert_management_alert,
Types::AlertManagement::AlertType,
null: true,
description: 'Alert associated to this issue'
description: 'Alert associated to this issue.'
field :severity, Types::IssuableSeverityEnum, null: true,
description: 'Severity level of the incident'
description: 'Severity level of the incident.'
field :moved, GraphQL::BOOLEAN_TYPE, method: :moved?, null: true,
description: 'Indicates if issue got moved from other project'
description: 'Indicates if issue got moved from other project.'
field :moved_to, Types::IssueType, null: true,
description: 'Updated Issue after it got moved to another project'
description: 'Updated Issue after it got moved to another project.'
field :create_note_email, GraphQL::STRING_TYPE, null: true,
description: 'User specific email address for the issue'
description: 'User specific email address for the issue.'
def author
Gitlab::Graphql::Loaders::BatchModelLoader.new(User, object.author_id).find
......
......@@ -7,19 +7,19 @@ module Types
graphql_name 'JiraImport'
field :created_at, Types::TimeType, null: true,
description: 'Timestamp of when the Jira import was created'
description: 'Timestamp of when the Jira import was created.'
field :scheduled_at, Types::TimeType, null: true,
description: 'Timestamp of when the Jira import was scheduled'
description: 'Timestamp of when the Jira import was scheduled.'
field :scheduled_by, Types::UserType, null: true,
description: 'User that started the Jira import'
description: 'User that started the Jira import.'
field :jira_project_key, GraphQL::STRING_TYPE, null: false,
description: 'Project key for the imported Jira project'
description: 'Project key for the imported Jira project.'
field :imported_issues_count, GraphQL::INT_TYPE, null: false,
description: 'Count of issues that were successfully imported'
description: 'Count of issues that were successfully imported.'
field :failed_to_import_count, GraphQL::INT_TYPE, null: false,
description: 'Count of issues that failed to import'
description: 'Count of issues that failed to import.'
field :total_issue_count, GraphQL::INT_TYPE, null: false,
description: 'Total count of issues that were attempted to import'
description: 'Total count of issues that were attempted to import.'
end
# rubocop: enable Graphql/AuthorizeTypes
end
......@@ -7,17 +7,17 @@ module Types
graphql_name 'JiraUser'
field :jira_account_id, GraphQL::STRING_TYPE, null: false,
description: 'Account ID of the Jira user'
description: 'Account ID of the Jira user.'
field :jira_display_name, GraphQL::STRING_TYPE, null: false,
description: 'Display name of the Jira user'
description: 'Display name of the Jira user.'
field :jira_email, GraphQL::STRING_TYPE, null: true,
description: 'Email of the Jira user, returned only for users with public emails'
description: 'Email of the Jira user, returned only for users with public emails.'
field :gitlab_id, GraphQL::INT_TYPE, null: true,
description: 'ID of the matched GitLab user'
description: 'ID of the matched GitLab user.'
field :gitlab_username, GraphQL::STRING_TYPE, null: true,
description: 'Username of the matched GitLab user'
description: 'Username of the matched GitLab user.'
field :gitlab_name, GraphQL::STRING_TYPE, null: true,
description: 'Name of the matched GitLab user'
description: 'Name of the matched GitLab user.'
end
# rubocop: enable Graphql/AuthorizeTypes
end
......@@ -8,11 +8,11 @@ module Types
argument :jira_account_id,
GraphQL::STRING_TYPE,
required: true,
description: 'Jira account ID of the user'
description: 'Jira account ID of the user.'
argument :gitlab_id,
GraphQL::INT_TYPE,
required: false,
description: 'Id of the GitLab user'
description: 'Id of the GitLab user.'
end
# rubocop: enable Graphql/AuthorizeTypes
end
......@@ -9,15 +9,15 @@ module Types
authorize :read_label
field :id, GraphQL::ID_TYPE, null: false,
description: 'Label ID'
description: 'Label ID.'
field :description, GraphQL::STRING_TYPE, null: true,
description: 'Description of the label (Markdown rendered as HTML for caching)'
description: 'Description of the label (Markdown rendered as HTML for caching).'
markdown_field :description_html, null: true
field :title, GraphQL::STRING_TYPE, null: false,
description: 'Content of the label'
description: 'Content of the label.'
field :color, GraphQL::STRING_TYPE, null: false,
description: 'Background color of the label'
description: 'Background color of the label.'
field :text_color, GraphQL::STRING_TYPE, null: false,
description: 'Text color of the label'
description: 'Text color of the label.'
end
end
......@@ -5,25 +5,25 @@ module Types
include BaseInterface
field :id, GraphQL::ID_TYPE, null: false,
description: 'ID of the member'
description: 'ID of the member.'
field :access_level, Types::AccessLevelType, null: true,
description: 'GitLab::Access level'
description: 'GitLab::Access level.'
field :created_by, Types::UserType, null: true,
description: 'User that authorized membership'
description: 'User that authorized membership.'
field :created_at, Types::TimeType, null: true,
description: 'Date and time the membership was created'
description: 'Date and time the membership was created.'
field :updated_at, Types::TimeType, null: true,
description: 'Date and time the membership was last updated'
description: 'Date and time the membership was last updated.'
field :expires_at, Types::TimeType, null: true,
description: 'Date and time the membership expires'
description: 'Date and time the membership expires.'
field :user, Types::UserType, null: false,
description: 'User that is associated with the member object'
description: 'User that is associated with the member object.'
definition_methods do
def resolve_type(object, context)
......
......@@ -4,7 +4,7 @@ module Types
# rubocop: disable Graphql/AuthorizeTypes
class MergeRequestConnectionType < Types::CountableConnectionType
field :total_time_to_merge, GraphQL::FLOAT_TYPE, null: true,
description: 'Total sum of time to merge, in seconds, for the collection of merge requests'
description: 'Total sum of time to merge, in seconds, for the collection of merge requests.'
# rubocop: disable CodeReuse/ActiveRecord
def total_time_to_merge
......
This diff is collapsed.
......@@ -7,8 +7,8 @@ module Types
authorize :read_instance_metadata
field :version, GraphQL::STRING_TYPE, null: false,
description: 'Version'
description: 'Version.'
field :revision, GraphQL::STRING_TYPE, null: false,
description: 'Revision'
description: 'Revision.'
end
end
......@@ -8,13 +8,13 @@ module Types
graphql_name 'MetricsDashboard'
field :path, GraphQL::STRING_TYPE, null: true,
description: 'Path to a file with the dashboard definition'
description: 'Path to a file with the dashboard definition.'
field :schema_validation_warnings, [GraphQL::STRING_TYPE], null: true,
description: 'Dashboard schema validation warnings'
description: 'Dashboard schema validation warnings.'
field :annotations, Types::Metrics::Dashboards::AnnotationType.connection_type, null: true,
description: 'Annotations added to the dashboard',
description: 'Annotations added to the dashboard.',
resolver: Resolvers::Metrics::Dashboards::AnnotationResolver
# In order to maintain backward compatibility we need to return NULL when there are no warnings
......
......@@ -8,19 +8,19 @@ module Types
graphql_name 'MetricsDashboardAnnotation'
field :description, GraphQL::STRING_TYPE, null: true,
description: 'Description of the annotation'
description: 'Description of the annotation.'
field :id, GraphQL::ID_TYPE, null: false,
description: 'ID of the annotation'
description: 'ID of the annotation.'
field :panel_id, GraphQL::STRING_TYPE, null: true,
description: 'ID of a dashboard panel to which the annotation should be scoped'
description: 'ID of a dashboard panel to which the annotation should be scoped.'
field :starting_at, Types::TimeType, null: true,
description: 'Timestamp marking start of annotated time span'
description: 'Timestamp marking start of annotated time span.'
field :ending_at, Types::TimeType, null: true,
description: 'Timestamp marking end of annotated time span'
description: 'Timestamp marking end of annotated time span.'
def panel_id
object.panel_xid
......
......@@ -8,9 +8,9 @@ module Types
authorize :read_milestone
field :total_issues_count, GraphQL::INT_TYPE, null: true,
description: 'Total number of issues associated with the milestone'
description: 'Total number of issues associated with the milestone.'
field :closed_issues_count, GraphQL::INT_TYPE, null: true,
description: 'Number of closed issues associated with the milestone'
description: 'Number of closed issues associated with the milestone.'
end
end
......@@ -12,46 +12,46 @@ module Types
alias_method :milestone, :object
field :id, GraphQL::ID_TYPE, null: false,
description: 'ID of the milestone'
description: 'ID of the milestone.'
field :title, GraphQL::STRING_TYPE, null: false,
description: 'Title of the milestone'
description: 'Title of the milestone.'
field :description, GraphQL::STRING_TYPE, null: true,
description: 'Description of the milestone'
description: 'Description of the milestone.'
field :state, Types::MilestoneStateEnum, null: false,
description: 'State of the milestone'
description: 'State of the milestone.'
field :web_path, GraphQL::STRING_TYPE, null: false, method: :milestone_path,
description: 'Web path of the milestone'
description: 'Web path of the milestone.'
field :due_date, Types::TimeType, null: true,
description: 'Timestamp of the milestone due date'
description: 'Timestamp of the milestone due date.'
field :start_date, Types::TimeType, null: true,
description: 'Timestamp of the milestone start date'
description: 'Timestamp of the milestone start date.'
field :created_at, Types::TimeType, null: false,
description: 'Timestamp of milestone creation'
description: 'Timestamp of milestone creation.'
field :updated_at, Types::TimeType, null: false,
description: 'Timestamp of last milestone update'
description: 'Timestamp of last milestone update.'
field :project_milestone, GraphQL::BOOLEAN_TYPE, null: false,
description: 'Indicates if milestone is at project level',
description: 'Indicates if milestone is at project level.',
method: :project_milestone?
field :group_milestone, GraphQL::BOOLEAN_TYPE, null: false,
description: 'Indicates if milestone is at group level',
description: 'Indicates if milestone is at group level.',
method: :group_milestone?
field :subgroup_milestone, GraphQL::BOOLEAN_TYPE, null: false,
description: 'Indicates if milestone is at subgroup level',
description: 'Indicates if milestone is at subgroup level.',
method: :subgroup_milestone?
field :stats, Types::MilestoneStatsType, null: true,
description: 'Milestone statistics'
description: 'Milestone statistics.'
def stats
return unless Feature.enabled?(:graphql_milestone_stats, milestone.project || milestone.group, default_enabled: true)
......
......@@ -7,40 +7,40 @@ module Types
authorize :read_namespace
field :id, GraphQL::ID_TYPE, null: false,
description: 'ID of the namespace'
description: 'ID of the namespace.'
field :name, GraphQL::STRING_TYPE, null: false,
description: 'Name of the namespace'
description: 'Name of the namespace.'
field :path, GraphQL::STRING_TYPE, null: false,
description: 'Path of the namespace'
description: 'Path of the namespace.'
field :full_name, GraphQL::STRING_TYPE, null: false,
description: 'Full name of the namespace'
description: 'Full name of the namespace.'
field :full_path, GraphQL::ID_TYPE, null: false,
description: 'Full path of the namespace'
description: 'Full path of the namespace.'
field :description, GraphQL::STRING_TYPE, null: true,
description: 'Description of the namespace'
description: 'Description of the namespace.'
markdown_field :description_html, null: true
field :visibility, GraphQL::STRING_TYPE, null: true,
description: 'Visibility of the namespace'
description: 'Visibility of the namespace.'
field :lfs_enabled, GraphQL::BOOLEAN_TYPE, null: true, method: :lfs_enabled?,
description: 'Indicates if Large File Storage (LFS) is enabled for namespace'
description: 'Indicates if Large File Storage (LFS) is enabled for namespace.'
field :request_access_enabled, GraphQL::BOOLEAN_TYPE, null: true,
description: 'Indicates if users can request access to namespace'
description: 'Indicates if users can request access to namespace.'
field :root_storage_statistics, Types::RootStorageStatisticsType,
null: true,
description: 'Aggregated storage statistics of the namespace. Only available for root namespaces'
description: 'Aggregated storage statistics of the namespace. Only available for root namespaces.'
field :projects, Types::ProjectType.connection_type, null: false,
description: 'Projects within this namespace',
description: 'Projects within this namespace.',
resolver: ::Resolvers::NamespaceProjectsResolver
field :package_settings,
Types::Namespace::PackageSettingsType,
null: true,
description: 'The package settings for the namespace'
description: 'The package settings for the namespace.'
def root_storage_statistics
Gitlab::Graphql::Loaders::BatchRootStorageStatisticsLoader.new(object.id).find
......
......@@ -8,32 +8,32 @@ module Types
graphql_name 'DiffPosition'
field :diff_refs, Types::DiffRefsType, null: false,
description: 'Information about the branch, HEAD, and base at the time of commenting'
description: 'Information about the branch, HEAD, and base at the time of commenting.'
field :file_path, GraphQL::STRING_TYPE, null: false,
description: 'Path of the file that was changed'
description: 'Path of the file that was changed.'
field :old_path, GraphQL::STRING_TYPE, null: true,
description: 'Path of the file on the start SHA'
description: 'Path of the file on the start SHA.'
field :new_path, GraphQL::STRING_TYPE, null: true,
description: 'Path of the file on the HEAD SHA'
description: 'Path of the file on the HEAD SHA.'
field :position_type, Types::Notes::PositionTypeEnum, null: false,
description: 'Type of file the position refers to'
description: 'Type of file the position refers to.'
# Fields for text positions
field :old_line, GraphQL::INT_TYPE, null: true,
description: 'Line on start SHA that was changed'
description: 'Line on start SHA that was changed.'
field :new_line, GraphQL::INT_TYPE, null: true,
description: 'Line on HEAD SHA that was changed'
description: 'Line on HEAD SHA that was changed.'
# Fields for image positions
field :x, GraphQL::INT_TYPE, null: true,
description: 'X position of the note'
description: 'X position of the note.'
field :y, GraphQL::INT_TYPE, null: true,
description: 'Y position of the note'
description: 'Y position of the note.'
field :width, GraphQL::INT_TYPE, null: true,
description: 'Total width of the image'
description: 'Total width of the image.'
field :height, GraphQL::INT_TYPE, null: true,
description: 'Total height of the image'
description: 'Total height of the image.'
def old_line
object.old_line if object.on_text?
......
......@@ -12,13 +12,13 @@ module Types
implements(Types::ResolvableInterface)
field :id, DiscussionID, null: false,
description: "ID of this discussion"
description: "ID of this discussion."
field :reply_id, DiscussionID, null: false,
description: 'ID used to reply to this discussion'
description: 'ID used to reply to this discussion.'
field :created_at, Types::TimeType, null: false,
description: "Timestamp of the discussion's creation"
description: "Timestamp of the discussion's creation."
field :notes, Types::Notes::NoteType.connection_type, null: false,
description: 'All notes in the discussion'
description: 'All notes in the discussion.'
# DiscussionID.coerce_result is suitable here, but will always mark this
# as being a 'Discussion'. Using `GlobalId.build` guarantees that we get
......
......@@ -12,43 +12,43 @@ module Types
implements(Types::ResolvableInterface)
field :id, ::Types::GlobalIDType[::Note], null: false,
description: 'ID of the note'
description: 'ID of the note.'
field :project, Types::ProjectType,
null: true,
description: 'Project associated with the note'
description: 'Project associated with the note.'
field :author, Types::UserType,
null: false,
description: 'User who wrote this note'
description: 'User who wrote this note.'
field :system, GraphQL::BOOLEAN_TYPE,
null: false,
description: 'Indicates whether this note was created by the system or by a user'
description: 'Indicates whether this note was created by the system or by a user.'
field :system_note_icon_name, GraphQL::STRING_TYPE, null: true,
description: 'Name of the icon corresponding to a system note'
description: 'Name of the icon corresponding to a system note.'
field :body, GraphQL::STRING_TYPE,
null: false,
method: :note,
description: 'Content of the note'
description: 'Content of the note.'
markdown_field :body_html, null: true, method: :note
field :created_at, Types::TimeType, null: false,
description: 'Timestamp of the note creation'
description: 'Timestamp of the note creation.'
field :updated_at, Types::TimeType, null: false,
description: "Timestamp of the note's last activity"
description: "Timestamp of the note's last activity."
field :discussion, Types::Notes::DiscussionType, null: true,
description: 'The discussion this note is a part of'
description: 'The discussion this note is a part of.'
field :position, Types::Notes::DiffPositionType, null: true,
description: 'The position of this note on a diff'
description: 'The position of this note on a diff.'
field :confidential, GraphQL::BOOLEAN_TYPE, null: true,
description: 'Indicates if this note is confidential',
description: 'Indicates if this note is confidential.',
method: :confidential?
field :url, GraphQL::STRING_TYPE,
null: true,
description: 'URL to view this Note in the Web UI'
description: 'URL to view this Note in the Web UI.'
def url
::Gitlab::UrlBuilder.build(object)
......
......@@ -5,8 +5,8 @@ module Types
module NoteableType
include Types::BaseInterface
field :notes, Types::Notes::NoteType.connection_type, null: false, description: "All notes on this noteable"
field :discussions, Types::Notes::DiscussionType.connection_type, null: false, description: "All discussions on this noteable"
field :notes, Types::Notes::NoteType.connection_type, null: false, description: "All notes on this noteable."
field :discussions, Types::Notes::DiscussionType.connection_type, null: false, description: "All discussions on this noteable."
def self.resolve_type(object, context)
case object
......
......@@ -12,7 +12,7 @@ module Types
authorize :read_project
field :project, Types::ProjectType, null: true,
description: 'Project ID for the project of the invitation'
description: 'Project ID for the project of the invitation.'
def project
Gitlab::Graphql::Loaders::BatchModelLoader.new(Project, object.source_id).find
......
......@@ -12,7 +12,7 @@ module Types
authorize :read_project
field :project, Types::ProjectType, null: true,
description: 'Project that User is a member of'
description: 'Project that User is a member of.'
def project
Gitlab::Graphql::Loaders::BatchModelLoader.new(Project, object.source_id).find
......
......@@ -7,23 +7,23 @@ module Types
authorize :read_statistics
field :commit_count, GraphQL::FLOAT_TYPE, null: false,
description: 'Commit count of the project'
description: 'Commit count of the project.'
field :storage_size, GraphQL::FLOAT_TYPE, null: false,
description: 'Storage size of the project in bytes'
description: 'Storage size of the project in bytes.'
field :repository_size, GraphQL::FLOAT_TYPE, null: false,
description: 'Repository size of the project in bytes'
description: 'Repository size of the project in bytes.'
field :lfs_objects_size, GraphQL::FLOAT_TYPE, null: false,
description: 'Large File Storage (LFS) object size of the project in bytes'
description: 'Large File Storage (LFS) object size of the project in bytes.'
field :build_artifacts_size, GraphQL::FLOAT_TYPE, null: false,
description: 'Build artifacts size of the project in bytes'
description: 'Build artifacts size of the project in bytes.'
field :packages_size, GraphQL::FLOAT_TYPE, null: false,
description: 'Packages size of the project in bytes'
description: 'Packages size of the project in bytes.'
field :wiki_size, GraphQL::FLOAT_TYPE, null: true,
description: 'Wiki size of the project in bytes'
description: 'Wiki size of the project in bytes.'
field :snippets_size, GraphQL::FLOAT_TYPE, null: true,
description: 'Snippets size of the project in bytes'
description: 'Snippets size of the project in bytes.'
field :uploads_size, GraphQL::FLOAT_TYPE, null: true,
description: 'Uploads size of the project in bytes'
description: 'Uploads size of the project in bytes.'
end
end
This diff is collapsed.
......@@ -9,9 +9,9 @@ module Types
# TODO: Add all the fields that we want to expose for the project services integrations
# https://gitlab.com/gitlab-org/gitlab/-/issues/213088
field :type, GraphQL::STRING_TYPE, null: true,
description: 'Class name of the service'
description: 'Class name of the service.'
field :active, GraphQL::BOOLEAN_TYPE, null: true,
description: 'Indicates if the service is active'
description: 'Indicates if the service is active.'
definition_methods do
def resolve_type(object, context)
......
......@@ -8,12 +8,12 @@ module Types
graphql_name 'JiraProject'
field :key, GraphQL::STRING_TYPE, null: false,
description: 'Key of the Jira project'
description: 'Key of the Jira project.'
field :project_id, GraphQL::INT_TYPE, null: false,
description: 'ID of the Jira project',
description: 'ID of the Jira project.',
method: :id
field :name, GraphQL::STRING_TYPE, null: true,
description: 'Name of the Jira project'
description: 'Name of the Jira project.'
end
# rubocop:enable Graphql/AuthorizeTypes
end
......
......@@ -13,7 +13,7 @@ module Types
field :projects,
Types::Projects::Services::JiraProjectType.connection_type,
null: true,
description: 'List of all Jira projects fetched through Jira REST API',
description: 'List of all Jira projects fetched through Jira REST API.',
resolver: Resolvers::Projects::JiraProjectsResolver
end
end
......
......@@ -10,11 +10,11 @@ module Types
present_using PrometheusAlertPresenter
field :id, GraphQL::ID_TYPE, null: false,
description: 'ID of the alert condition'
description: 'ID of the alert condition.'
field :humanized_text,
GraphQL::STRING_TYPE,
null: false,
description: 'The human-readable text of the alert condition'
description: 'The human-readable text of the alert condition.'
end
end
......@@ -10,89 +10,89 @@ module Types
field :project, Types::ProjectType,
null: true,
resolver: Resolvers::ProjectResolver,
description: "Find a project"
description: "Find a project."
field :projects, Types::ProjectType.connection_type,
null: true,
resolver: Resolvers::ProjectsResolver,
description: "Find projects visible to the current user"
description: "Find projects visible to the current user."
field :group, Types::GroupType,
null: true,
resolver: Resolvers::GroupResolver,
description: "Find a group"
description: "Find a group."
field :current_user, Types::UserType,
null: true,
description: "Get information about current user"
description: "Get information about current user."
field :namespace, Types::NamespaceType,
null: true,
resolver: Resolvers::NamespaceResolver,
description: "Find a namespace"
description: "Find a namespace."
field :metadata, Types::MetadataType,
null: true,
resolver: Resolvers::MetadataResolver,
description: 'Metadata about GitLab'
description: 'Metadata about GitLab.'
field :snippets,
Types::SnippetType.connection_type,
null: true,
resolver: Resolvers::SnippetsResolver,
description: 'Find Snippets visible to the current user'
description: 'Find Snippets visible to the current user.'
field :design_management, Types::DesignManagementType,
null: false,
description: 'Fields related to design management'
description: 'Fields related to design management.'
field :milestone, ::Types::MilestoneType,
null: true,
description: 'Find a milestone' do
argument :id, ::Types::GlobalIDType[Milestone], required: true, description: 'Find a milestone by its ID'
description: 'Find a milestone.' do
argument :id, ::Types::GlobalIDType[Milestone], required: true, description: 'Find a milestone by its ID.'
end
field :container_repository, Types::ContainerRepositoryDetailsType,
null: true,
description: 'Find a container repository' do
argument :id, ::Types::GlobalIDType[::ContainerRepository], required: true, description: 'The global ID of the container repository'
description: 'Find a container repository.' do
argument :id, ::Types::GlobalIDType[::ContainerRepository], required: true, description: 'The global ID of the container repository.'
end
field :package,
description: 'Find a package',
description: 'Find a package.',
resolver: Resolvers::PackageDetailsResolver
field :user, Types::UserType,
null: true,
description: 'Find a user',
description: 'Find a user.',
resolver: Resolvers::UserResolver
field :users, Types::UserType.connection_type,
null: true,
description: 'Find users',
description: 'Find users.',
resolver: Resolvers::UsersResolver
field :echo, GraphQL::STRING_TYPE, null: false,
description: 'Text to echo back',
description: 'Text to echo back.',
resolver: Resolvers::EchoResolver
field :issue, Types::IssueType,
null: true,
description: 'Find an issue' do
argument :id, ::Types::GlobalIDType[::Issue], required: true, description: 'The global ID of the Issue'
description: 'Find an issue.' do
argument :id, ::Types::GlobalIDType[::Issue], required: true, description: 'The global ID of the Issue.'
end
field :instance_statistics_measurements, Types::Admin::Analytics::InstanceStatistics::MeasurementType.connection_type,
null: true,
description: 'Get statistics on the instance',
description: 'Get statistics on the instance.',
resolver: Resolvers::Admin::Analytics::InstanceStatistics::MeasurementsResolver
field :runner_platforms, Types::Ci::RunnerPlatformType.connection_type,
null: true, description: 'Supported runner platforms',
null: true, description: 'Supported runner platforms.',
resolver: Resolvers::Ci::RunnerPlatformsResolver
field :runner_setup, Types::Ci::RunnerSetupType, null: true,
description: 'Get runner setup instructions',
description: 'Get runner setup instructions.',
resolver: Resolvers::Ci::RunnerSetupResolver
field :ci_config, Types::Ci::Config::ConfigType, null: true,
......
......@@ -9,11 +9,11 @@ module Types
@subtypes[[type, closed]] ||= Class.new(self) do
argument :start, type,
required: closed,
description: 'The start of the range'
description: 'The start of the range.'
argument :end, type,
required: closed,
description: 'The end of the range'
description: 'The end of the range.'
end
end
......
......@@ -8,18 +8,18 @@ module Types
argument :name, GraphQL::STRING_TYPE,
required: true,
description: 'Name of the asset link'
description: 'Name of the asset link.'
argument :url, GraphQL::STRING_TYPE,
required: true,
description: 'URL of the asset link'
description: 'URL of the asset link.'
argument :direct_asset_path, GraphQL::STRING_TYPE,
required: false, as: :filepath,
description: 'Relative path for a direct asset link'
description: 'Relative path for a direct asset link.'
argument :link_type, Types::ReleaseAssetLinkTypeEnum,
required: false, default_value: 'other',
description: 'The type of the asset link'
description: 'The type of the asset link.'
end
end
......@@ -8,18 +8,18 @@ module Types
authorize :read_release
field :id, GraphQL::ID_TYPE, null: false,
description: 'ID of the link'
description: 'ID of the link.'
field :name, GraphQL::STRING_TYPE, null: true,
description: 'Name of the link'
description: 'Name of the link.'
field :url, GraphQL::STRING_TYPE, null: true,
description: 'URL of the link'
description: 'URL of the link.'
field :link_type, Types::ReleaseAssetLinkTypeEnum, null: true,
description: 'Type of the link: `other`, `runbook`, `image`, `package`; defaults to `other`'
description: 'Type of the link: `other`, `runbook`, `image`, `package`; defaults to `other`.'
field :external, GraphQL::BOOLEAN_TYPE, null: true, method: :external?,
description: 'Indicates the link points to an external resource'
description: 'Indicates the link points to an external resource.'
field :direct_asset_url, GraphQL::STRING_TYPE, null: true,
description: 'Direct asset URL of the link'
description: 'Direct asset URL of the link.'
def direct_asset_url
return object.url unless object.filepath
......
......@@ -8,6 +8,6 @@ module Types
argument :links, [Types::ReleaseAssetLinkInputType],
required: false,
description: 'A list of asset links to associate to the release'
description: 'A list of asset links to associate to the release.'
end
end
......@@ -12,10 +12,10 @@ module Types
present_using ReleasePresenter
field :count, GraphQL::INT_TYPE, null: true, method: :assets_count,
description: 'Number of assets of the release'
description: 'Number of assets of the release.'
field :links, Types::ReleaseAssetLinkType.connection_type, null: true,
description: 'Asset links of the release'
description: 'Asset links of the release.'
field :sources, Types::ReleaseSourceType.connection_type, null: true,
description: 'Sources of the release'
description: 'Sources of the release.'
end
end
......@@ -11,19 +11,19 @@ module Types
present_using ReleasePresenter
field :self_url, GraphQL::STRING_TYPE, null: true,
description: 'HTTP URL of the release'
description: 'HTTP URL of the release.'
field :edit_url, GraphQL::STRING_TYPE, null: true,
description: "HTTP URL of the release's edit page",
description: "HTTP URL of the release's edit page.",
authorize: :update_release
field :opened_merge_requests_url, GraphQL::STRING_TYPE, null: true,
description: 'HTTP URL of the merge request page, filtered by this release and `state=open`'
description: 'HTTP URL of the merge request page, filtered by this release and `state=open`.'
field :merged_merge_requests_url, GraphQL::STRING_TYPE, null: true,
description: 'HTTP URL of the merge request page , filtered by this release and `state=merged`'
description: 'HTTP URL of the merge request page , filtered by this release and `state=merged`.'
field :closed_merge_requests_url, GraphQL::STRING_TYPE, null: true,
description: 'HTTP URL of the merge request page , filtered by this release and `state=closed`'
description: 'HTTP URL of the merge request page , filtered by this release and `state=closed`.'
field :opened_issues_url, GraphQL::STRING_TYPE, null: true,
description: 'HTTP URL of the issues page, filtered by this release and `state=open`'
description: 'HTTP URL of the issues page, filtered by this release and `state=open`.'
field :closed_issues_url, GraphQL::STRING_TYPE, null: true,
description: 'HTTP URL of the issues page, filtered by this release and `state=closed`'
description: 'HTTP URL of the issues page, filtered by this release and `state=closed`.'
end
end
......@@ -8,8 +8,8 @@ module Types
authorize :download_code
field :format, GraphQL::STRING_TYPE, null: true,
description: 'Format of the source'
description: 'Format of the source.'
field :url, GraphQL::STRING_TYPE, null: true,
description: 'Download URL of the source'
description: 'Download URL of the source.'
end
end
......@@ -14,34 +14,34 @@ module Types
present_using ReleasePresenter
field :tag_name, GraphQL::STRING_TYPE, null: true, method: :tag,
description: 'Name of the tag associated with the release',
description: 'Name of the tag associated with the release.',
authorize: :download_code
field :tag_path, GraphQL::STRING_TYPE, null: true,
description: 'Relative web path to the tag associated with the release',
description: 'Relative web path to the tag associated with the release.',
authorize: :download_code
field :description, GraphQL::STRING_TYPE, null: true,
description: 'Description (also known as "release notes") of the release'
description: 'Description (also known as "release notes") of the release.'
markdown_field :description_html, null: true
field :name, GraphQL::STRING_TYPE, null: true,
description: 'Name of the release'
description: 'Name of the release.'
field :created_at, Types::TimeType, null: true,
description: 'Timestamp of when the release was created'
description: 'Timestamp of when the release was created.'
field :released_at, Types::TimeType, null: true,
description: 'Timestamp of when the release was released'
description: 'Timestamp of when the release was released.'
field :upcoming_release, GraphQL::BOOLEAN_TYPE, null: true, method: :upcoming_release?,
description: 'Indicates the release is an upcoming release'
description: 'Indicates the release is an upcoming release.'
field :assets, Types::ReleaseAssetsType, null: true, method: :itself,
description: 'Assets of the release'
description: 'Assets of the release.'
field :links, Types::ReleaseLinksType, null: true, method: :itself,
description: 'Links of the release'
description: 'Links of the release.'
field :milestones, Types::MilestoneType.connection_type, null: true,
description: 'Milestones associated to the release',
description: 'Milestones associated to the release.',
resolver: ::Resolvers::ReleaseMilestonesResolver
field :evidences, Types::EvidenceType.connection_type, null: true,
description: 'Evidence for the release'
description: 'Evidence for the release.'
field :author, Types::UserType, null: true,
description: 'User that created the release'
description: 'User that created the release.'
def author
Gitlab::Graphql::Loaders::BatchModelLoader.new(User, release.author_id).find
......@@ -49,7 +49,7 @@ module Types
field :commit, Types::CommitType, null: true,
complexity: 10, calls_gitaly: true,
description: 'The commit associated with the release'
description: 'The commit associated with the release.'
def commit
return if release.sha.nil?
......
......@@ -7,12 +7,12 @@ module Types
authorize :download_code
field :root_ref, GraphQL::STRING_TYPE, null: true, calls_gitaly: true,
description: 'Default branch of the repository'
description: 'Default branch of the repository.'
field :empty, GraphQL::BOOLEAN_TYPE, null: false, method: :empty?, calls_gitaly: true,
description: 'Indicates repository has no visible content'
description: 'Indicates repository has no visible content.'
field :exists, GraphQL::BOOLEAN_TYPE, null: false, method: :exists?, calls_gitaly: true,
description: 'Indicates a corresponding Git repository exists on disk'
description: 'Indicates a corresponding Git repository exists on disk.'
field :tree, Types::Tree::TreeType, null: true, resolver: Resolvers::TreeResolver, calls_gitaly: true,
description: 'Tree of the repository'
description: 'Tree of the repository.'
end
end
......@@ -8,7 +8,7 @@ module Types
field :resolved_by, Types::UserType,
null: true,
description: 'User who resolved the object'
description: 'User who resolved the object.'
def resolved_by
return unless object.resolved_by_id
......@@ -17,12 +17,12 @@ module Types
end
field :resolved, GraphQL::BOOLEAN_TYPE, null: false,
description: 'Indicates if the object is resolved',
description: 'Indicates if the object is resolved.',
method: :resolved?
field :resolvable, GraphQL::BOOLEAN_TYPE, null: false,
description: 'Indicates if the object can be resolved',
description: 'Indicates if the object can be resolved.',
method: :resolvable?
field :resolved_at, Types::TimeType, null: true,
description: 'Timestamp of when the object was resolved'
description: 'Timestamp of when the object was resolved.'
end
end
......@@ -6,14 +6,14 @@ module Types
authorize :read_statistics
field :storage_size, GraphQL::FLOAT_TYPE, null: false, description: 'The total storage in bytes'
field :repository_size, GraphQL::FLOAT_TYPE, null: false, description: 'The Git repository size in bytes'
field :lfs_objects_size, GraphQL::FLOAT_TYPE, null: false, description: 'The LFS objects size in bytes'
field :build_artifacts_size, GraphQL::FLOAT_TYPE, null: false, description: 'The CI artifacts size in bytes'
field :packages_size, GraphQL::FLOAT_TYPE, null: false, description: 'The packages size in bytes'
field :wiki_size, GraphQL::FLOAT_TYPE, null: false, description: 'The wiki size in bytes'
field :snippets_size, GraphQL::FLOAT_TYPE, null: false, description: 'The snippets size in bytes'
field :pipeline_artifacts_size, GraphQL::FLOAT_TYPE, null: false, description: 'The CI pipeline artifacts size in bytes'
field :uploads_size, GraphQL::FLOAT_TYPE, null: false, description: 'The uploads size in bytes'
field :storage_size, GraphQL::FLOAT_TYPE, null: false, description: 'The total storage in bytes.'
field :repository_size, GraphQL::FLOAT_TYPE, null: false, description: 'The Git repository size in bytes.'
field :lfs_objects_size, GraphQL::FLOAT_TYPE, null: false, description: 'The LFS objects size in bytes.'
field :build_artifacts_size, GraphQL::FLOAT_TYPE, null: false, description: 'The CI artifacts size in bytes.'
field :packages_size, GraphQL::FLOAT_TYPE, null: false, description: 'The packages size in bytes.'
field :wiki_size, GraphQL::FLOAT_TYPE, null: false, description: 'The wiki size in bytes.'
field :snippets_size, GraphQL::FLOAT_TYPE, null: false, description: 'The snippets size in bytes.'
field :pipeline_artifacts_size, GraphQL::FLOAT_TYPE, null: false, description: 'The CI pipeline artifacts size in bytes.'
field :uploads_size, GraphQL::FLOAT_TYPE, null: false, description: 'The uploads size in bytes.'
end
end
......@@ -14,15 +14,15 @@ module Types
expose_permissions Types::PermissionTypes::Snippet
field :id, Types::GlobalIDType[::Snippet],
description: 'ID of the snippet',
description: 'ID of the snippet.',
null: false
field :title, GraphQL::STRING_TYPE,
description: 'Title of the snippet',
description: 'Title of the snippet.',
null: false
field :project, Types::ProjectType,
description: 'The project the snippet is associated with',
description: 'The project the snippet is associated with.',
null: true,
authorize: :read_project
......@@ -30,56 +30,56 @@ module Types
# when the admin setting restricted visibility
# level is set to public
field :author, Types::UserType,
description: 'The owner of the snippet',
description: 'The owner of the snippet.',
null: true
field :file_name, GraphQL::STRING_TYPE,
description: 'File Name of the snippet',
description: 'File Name of the snippet.',
null: true
field :description, GraphQL::STRING_TYPE,
description: 'Description of the snippet',
description: 'Description of the snippet.',
null: true
field :visibility_level, Types::VisibilityLevelsEnum,
description: 'Visibility Level of the snippet',
description: 'Visibility Level of the snippet.',
null: false
field :created_at, Types::TimeType,
description: 'Timestamp this snippet was created',
description: 'Timestamp this snippet was created.',
null: false
field :updated_at, Types::TimeType,
description: 'Timestamp this snippet was updated',
description: 'Timestamp this snippet was updated.',
null: false
field :web_url, type: GraphQL::STRING_TYPE,
description: 'Web URL of the snippet',
description: 'Web URL of the snippet.',
null: false
field :raw_url, type: GraphQL::STRING_TYPE,
description: 'Raw URL of the snippet',
description: 'Raw URL of the snippet.',
null: false
field :blob, type: Types::Snippets::BlobType,
description: 'Snippet blob',
description: 'Snippet blob.',
calls_gitaly: true,
null: false,
deprecated: { reason: 'Use `blobs`', milestone: '13.3' }
field :blobs, type: Types::Snippets::BlobType.connection_type,
description: 'Snippet blobs',
description: 'Snippet blobs.',
calls_gitaly: true,
null: true,
resolver: Resolvers::Snippets::BlobsResolver
field :ssh_url_to_repo, type: GraphQL::STRING_TYPE,
description: 'SSH URL to the snippet repository',
description: 'SSH URL to the snippet repository.',
calls_gitaly: true,
null: true
field :http_url_to_repo, type: GraphQL::STRING_TYPE,
description: 'HTTP URL to the snippet repository',
description: 'HTTP URL to the snippet repository.',
calls_gitaly: true,
null: true
......
......@@ -7,19 +7,19 @@ module Types
description 'Represents an action to perform over a snippet file'
argument :action, Types::Snippets::BlobActionEnum,
description: 'Type of input action',
description: 'Type of input action.',
required: true
argument :previous_path, GraphQL::STRING_TYPE,
description: 'Previous path of the snippet file',
description: 'Previous path of the snippet file.',
required: false
argument :file_path, GraphQL::STRING_TYPE,
description: 'Path of the snippet file',
description: 'Path of the snippet file.',
required: true
argument :content, GraphQL::STRING_TYPE,
description: 'Snippet file content',
description: 'Snippet file content.',
required: false
end
end
......
......@@ -9,53 +9,53 @@ module Types
present_using SnippetBlobPresenter
field :rich_data, GraphQL::STRING_TYPE,
description: 'Blob highlighted data',
description: 'Blob highlighted data.',
null: true
field :plain_data, GraphQL::STRING_TYPE,
description: 'Blob plain highlighted data',
description: 'Blob plain highlighted data.',
calls_gitaly: true,
null: true
field :raw_path, GraphQL::STRING_TYPE,
description: 'Blob raw content endpoint path',
description: 'Blob raw content endpoint path.',
null: false
field :size, GraphQL::INT_TYPE,
description: 'Blob size',
description: 'Blob size.',
null: false
field :binary, GraphQL::BOOLEAN_TYPE,
description: 'Shows whether the blob is binary',
description: 'Shows whether the blob is binary.',
method: :binary?,
null: false
field :name, GraphQL::STRING_TYPE,
description: 'Blob name',
description: 'Blob name.',
null: true
field :path, GraphQL::STRING_TYPE,
description: 'Blob path',
description: 'Blob path.',
null: true
field :simple_viewer, type: Types::Snippets::BlobViewerType,
description: 'Blob content simple viewer',
description: 'Blob content simple viewer.',
null: false
field :rich_viewer, type: Types::Snippets::BlobViewerType,
description: 'Blob content rich viewer',
description: 'Blob content rich viewer.',
null: true
field :mode, type: GraphQL::STRING_TYPE,
description: 'Blob mode',
description: 'Blob mode.',
null: true
field :external_storage, type: GraphQL::STRING_TYPE,
description: 'Blob external storage',
description: 'Blob external storage.',
null: true
field :rendered_as_text, type: GraphQL::BOOLEAN_TYPE,
description: 'Shows whether the blob is rendered as text',
description: 'Shows whether the blob is rendered as text.',
method: :rendered_as_text?,
null: false
end
......
......@@ -7,34 +7,34 @@ module Types
description 'Represents how the blob content should be displayed'
field :type, Types::BlobViewers::TypeEnum,
description: 'Type of blob viewer',
description: 'Type of blob viewer.',
null: false
field :load_async, GraphQL::BOOLEAN_TYPE,
description: 'Shows whether the blob content is loaded asynchronously',
description: 'Shows whether the blob content is loaded asynchronously.',
null: false
field :collapsed, GraphQL::BOOLEAN_TYPE,
description: 'Shows whether the blob should be displayed collapsed',
description: 'Shows whether the blob should be displayed collapsed.',
method: :collapsed?,
null: false
field :too_large, GraphQL::BOOLEAN_TYPE,
description: 'Shows whether the blob too large to be displayed',
description: 'Shows whether the blob too large to be displayed.',
method: :too_large?,
null: false
field :render_error, GraphQL::STRING_TYPE,
description: 'Error rendering the blob content',
description: 'Error rendering the blob content.',
null: true
field :file_type, GraphQL::STRING_TYPE,
description: 'Content file type',
description: 'Content file type.',
method: :partial_name,
null: false
field :loading_partial_name, GraphQL::STRING_TYPE,
description: 'Loading partial name',
description: 'Loading partial name.',
null: false
def collapsed
......
......@@ -9,9 +9,9 @@ module Types
description 'Completion status of tasks'
field :count, GraphQL::INT_TYPE, null: false,
description: 'Number of total tasks'
description: 'Number of total tasks.'
field :completed_count, GraphQL::INT_TYPE, null: false,
description: 'Number of completed tasks'
description: 'Number of completed tasks.'
end
# rubocop: enable Graphql/AuthorizeTypes
end
......@@ -11,32 +11,32 @@ module Types
field :id, GraphQL::ID_TYPE,
null: false,
description: 'ID of the Terraform state'
description: 'ID of the Terraform state.'
field :name, GraphQL::STRING_TYPE,
null: false,
description: 'Name of the Terraform state'
description: 'Name of the Terraform state.'
field :locked_by_user, Types::UserType,
null: true,
description: 'The user currently holding a lock on the Terraform state'
description: 'The user currently holding a lock on the Terraform state.'
field :locked_at, Types::TimeType,
null: true,
description: 'Timestamp the Terraform state was locked'
description: 'Timestamp the Terraform state was locked.'
field :latest_version, Types::Terraform::StateVersionType,
complexity: 3,
null: true,
description: 'The latest version of the Terraform state'
description: 'The latest version of the Terraform state.'
field :created_at, Types::TimeType,
null: false,
description: 'Timestamp the Terraform state was created'
description: 'Timestamp the Terraform state was created.'
field :updated_at, Types::TimeType,
null: false,
description: 'Timestamp the Terraform state was updated'
description: 'Timestamp the Terraform state was updated.'
def locked_by_user
Gitlab::Graphql::Loaders::BatchModelLoader.new(User, object.locked_by_user_id).find
......
......@@ -11,32 +11,32 @@ module Types
field :id, GraphQL::ID_TYPE,
null: false,
description: 'ID of the Terraform state version'
description: 'ID of the Terraform state version.'
field :created_by_user, Types::UserType,
null: true,
description: 'The user that created this version'
description: 'The user that created this version.'
field :download_path, GraphQL::STRING_TYPE,
null: true,
description: "URL for downloading the version's JSON file"
description: "URL for downloading the version's JSON file."
field :job, Types::Ci::JobType,
null: true,
description: 'The job that created this version'
description: 'The job that created this version.'
field :serial, GraphQL::INT_TYPE,
null: true,
description: 'Serial number of the version',
description: 'Serial number of the version.',
method: :version
field :created_at, Types::TimeType,
null: false,
description: 'Timestamp the version was created'
description: 'Timestamp the version was created.'
field :updated_at, Types::TimeType,
null: false,
description: 'Timestamp the version was updated'
description: 'Timestamp the version was updated.'
def created_by_user
Gitlab::Graphql::Loaders::BatchModelLoader.new(User, object.created_by_user_id).find
......
......@@ -10,42 +10,42 @@ module Types
authorize :read_todo
field :id, GraphQL::ID_TYPE,
description: 'ID of the to-do item',
description: 'ID of the to-do item.',
null: false
field :project, Types::ProjectType,
description: 'The project this to-do item is associated with',
description: 'The project this to-do item is associated with.',
null: true,
authorize: :read_project
field :group, Types::GroupType,
description: 'Group this to-do item is associated with',
description: 'Group this to-do item is associated with.',
null: true,
authorize: :read_group
field :author, Types::UserType,
description: 'The author of this to-do item',
description: 'The author of this to-do item.',
null: false
field :action, Types::TodoActionEnum,
description: 'Action of the to-do item',
description: 'Action of the to-do item.',
null: false
field :target_type, Types::TodoTargetEnum,
description: 'Target type of the to-do item',
description: 'Target type of the to-do item.',
null: false
field :body, GraphQL::STRING_TYPE,
description: 'Body of the to-do item',
description: 'Body of the to-do item.',
null: false,
calls_gitaly: true # TODO This is only true when `target_type` is `Commit`. See https://gitlab.com/gitlab-org/gitlab/issues/34757#note_234752665
field :state, Types::TodoStateEnum,
description: 'State of the to-do item',
description: 'State of the to-do item.',
null: false
field :created_at, Types::TimeType,
description: 'Timestamp this to-do item was created',
description: 'Timestamp this to-do item was created.',
null: false
def project
......
......@@ -11,13 +11,13 @@ module Types
graphql_name 'Blob'
field :web_url, GraphQL::STRING_TYPE, null: true,
description: 'Web URL of the blob'
description: 'Web URL of the blob.'
field :web_path, GraphQL::STRING_TYPE, null: true,
description: 'Web path of the blob'
description: 'Web path of the blob.'
field :lfs_oid, GraphQL::STRING_TYPE, null: true,
description: 'LFS ID of the blob'
description: 'LFS ID of the blob.'
field :mode, GraphQL::STRING_TYPE, null: true,
description: 'Blob mode in numeric format'
description: 'Blob mode in numeric format.'
def lfs_oid
Gitlab::Graphql::Loaders::BatchLfsOidLoader.new(object.repository, object.id).find
......
......@@ -5,17 +5,17 @@ module Types
include Types::BaseInterface
field :id, GraphQL::ID_TYPE, null: false,
description: 'ID of the entry'
description: 'ID of the entry.'
field :sha, GraphQL::STRING_TYPE, null: false,
description: 'Last commit SHA for the entry', method: :id
description: 'Last commit SHA for the entry.', method: :id
field :name, GraphQL::STRING_TYPE, null: false,
description: 'Name of the entry'
description: 'Name of the entry.'
field :type, Tree::TypeEnum, null: false,
description: 'Type of tree entry'
description: 'Type of tree entry.'
field :path, GraphQL::STRING_TYPE, null: false,
description: 'Path of the entry'
description: 'Path of the entry.'
field :flat_path, GraphQL::STRING_TYPE, null: false,
description: 'Flat path of the entry'
description: 'Flat path of the entry.'
end
end
end
......@@ -9,9 +9,9 @@ module Types
graphql_name 'Submodule'
field :web_url, type: GraphQL::STRING_TYPE, null: true,
description: 'Web URL for the sub-module'
description: 'Web URL for the sub-module.'
field :tree_url, type: GraphQL::STRING_TYPE, null: true,
description: 'Tree URL for the sub-module'
description: 'Tree URL for the sub-module.'
end
# rubocop: enable Graphql/AuthorizeTypes
end
......
......@@ -12,9 +12,9 @@ module Types
description 'Represents a directory'
field :web_url, GraphQL::STRING_TYPE, null: true,
description: 'Web URL for the tree entry (directory)'
description: 'Web URL for the tree entry (directory).'
field :web_path, GraphQL::STRING_TYPE, null: true,
description: 'Web path for the tree entry (directory)'
description: 'Web path for the tree entry (directory).'
end
# rubocop: enable Graphql/AuthorizeTypes
end
......
......@@ -9,17 +9,17 @@ module Types
# Complexity 10 as it triggers a Gitaly call on each render
field :last_commit, Types::CommitType,
null: true, complexity: 10, calls_gitaly: true, resolver: Resolvers::LastCommitResolver,
description: 'Last commit for the tree'
description: 'Last commit for the tree.'
field :trees, Types::Tree::TreeEntryType.connection_type, null: false,
description: 'Trees of the tree'
description: 'Trees of the tree.'
field :submodules, Types::Tree::SubmoduleType.connection_type, null: false,
description: 'Sub-modules of the tree',
description: 'Sub-modules of the tree.',
calls_gitaly: true
field :blobs, Types::Tree::BlobType.connection_type, null: false,
description: 'Blobs of the tree',
description: 'Blobs of the tree.',
calls_gitaly: true
def trees
......
......@@ -8,10 +8,10 @@ module Types
markdown_field :message_html, null: true,
description: 'HTML of the user status message'
field :message, GraphQL::STRING_TYPE, null: true,
description: 'User status message'
description: 'User status message.'
field :emoji, GraphQL::STRING_TYPE, null: true,
description: 'String representation of emoji'
description: 'String representation of emoji.'
field :availability, Types::AvailabilityEnum, null: false,
description: 'User availability status'
description: 'User availability status.'
end
end
......@@ -11,58 +11,58 @@ module Types
expose_permissions Types::PermissionTypes::User
field :id, GraphQL::ID_TYPE, null: false,
description: 'ID of the user'
description: 'ID of the user.'
field :username, GraphQL::STRING_TYPE, null: false,
description: 'Username of the user. Unique within this instance of GitLab'
description: 'Username of the user. Unique within this instance of GitLab.'
field :name, GraphQL::STRING_TYPE, null: false,
description: 'Human-readable name of the user'
description: 'Human-readable name of the user.'
field :state, Types::UserStateEnum, null: false,
description: 'State of the user'
description: 'State of the user.'
field :email, GraphQL::STRING_TYPE, null: true,
description: 'User email', method: :public_email,
description: 'User email.', method: :public_email,
deprecated: { reason: 'Use public_email', milestone: '13.7' }
field :public_email, GraphQL::STRING_TYPE, null: true,
description: "User's public email"
description: "User's public email."
field :avatar_url, GraphQL::STRING_TYPE, null: true,
description: "URL of the user's avatar"
description: "URL of the user's avatar."
field :web_url, GraphQL::STRING_TYPE, null: false,
description: 'Web URL of the user'
description: 'Web URL of the user.'
field :web_path, GraphQL::STRING_TYPE, null: false,
description: 'Web path of the user'
description: 'Web path of the user.'
field :todos, Types::TodoType.connection_type, null: false,
resolver: Resolvers::TodoResolver,
description: 'To-do items of the user'
description: 'To-do items of the user.'
field :group_memberships, Types::GroupMemberType.connection_type, null: true,
description: 'Group memberships of the user'
description: 'Group memberships of the user.'
field :group_count, GraphQL::INT_TYPE, null: true,
resolver: Resolvers::Users::GroupCountResolver,
description: 'Group count for the user',
description: 'Group count for the user.',
feature_flag: :user_group_counts
field :status, Types::UserStatusType, null: true,
description: 'User status'
description: 'User status.'
field :location, ::GraphQL::STRING_TYPE, null: true,
description: 'The location of the user.'
field :project_memberships, Types::ProjectMemberType.connection_type, null: true,
description: 'Project memberships of the user'
description: 'Project memberships of the user.'
field :starred_projects, Types::ProjectType.connection_type, null: true,
description: 'Projects starred by the user',
description: 'Projects starred by the user.',
resolver: Resolvers::UserStarredProjectsResolver
# Merge request field: MRs can be authored, assigned, or assigned-for-review:
field :authored_merge_requests,
resolver: Resolvers::AuthoredMergeRequestsResolver,
description: 'Merge Requests authored by the user'
description: 'Merge Requests authored by the user.'
field :assigned_merge_requests,
resolver: Resolvers::AssignedMergeRequestsResolver,
description: 'Merge Requests assigned to the user'
description: 'Merge Requests assigned to the user.'
field :review_requested_merge_requests,
resolver: Resolvers::ReviewRequestedMergeRequestsResolver,
description: 'Merge Requests assigned to the user for review'
description: 'Merge Requests assigned to the user for review.'
field :snippets,
Types::SnippetType.connection_type,
null: true,
description: 'Snippets authored by the user',
description: 'Snippets authored by the user.',
resolver: Resolvers::Users::SnippetsResolver
end
end
This diff is collapsed.
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