Commit a39986e8 authored by Siddharth Asthana's avatar Siddharth Asthana

Fix GraphQL/OrderedFields offenses

Changelog: other
parent 8b106806
...@@ -32,14 +32,6 @@ GraphQL/OrderedFields: ...@@ -32,14 +32,6 @@ GraphQL/OrderedFields:
- app/graphql/types/error_tracking/sentry_error_frequency_type.rb - app/graphql/types/error_tracking/sentry_error_frequency_type.rb
- app/graphql/types/error_tracking/sentry_error_stack_trace_context_type.rb - app/graphql/types/error_tracking/sentry_error_stack_trace_context_type.rb
- app/graphql/types/error_tracking/sentry_error_stack_trace_entry_type.rb - app/graphql/types/error_tracking/sentry_error_stack_trace_entry_type.rb
- app/graphql/types/error_tracking/sentry_error_stack_trace_type.rb
- app/graphql/types/error_tracking/sentry_error_type.rb
- app/graphql/types/evidence_type.rb
- app/graphql/types/grafana_integration_type.rb
- app/graphql/types/issue_type.rb
- app/graphql/types/jira_import_type.rb
- app/graphql/types/jira_user_type.rb
- app/graphql/types/label_type.rb
- app/graphql/types/merge_request_type.rb - app/graphql/types/merge_request_type.rb
- app/graphql/types/metadata/kas_type.rb - app/graphql/types/metadata/kas_type.rb
- app/graphql/types/metadata_type.rb - app/graphql/types/metadata_type.rb
......
...@@ -8,12 +8,12 @@ module Types ...@@ -8,12 +8,12 @@ module Types
authorize :read_sentry_issue authorize :read_sentry_issue
field :issue_id, GraphQL::Types::String,
null: false,
description: 'ID of the Sentry error.'
field :date_received, GraphQL::Types::String, field :date_received, GraphQL::Types::String,
null: false, null: false,
description: 'Time the stack trace was received by Sentry.' description: 'Time the stack trace was received by Sentry.'
field :issue_id, GraphQL::Types::String,
null: false,
description: 'ID of the Sentry error.'
field :stack_trace_entries, [Types::ErrorTracking::SentryErrorStackTraceEntryType], field :stack_trace_entries, [Types::ErrorTracking::SentryErrorStackTraceEntryType],
null: false, null: false,
description: 'Stack trace entries for the Sentry error.' description: 'Stack trace entries for the Sentry error.'
......
...@@ -9,49 +9,34 @@ module Types ...@@ -9,49 +9,34 @@ module Types
present_using SentryErrorPresenter present_using SentryErrorPresenter
field :id, GraphQL::Types::ID,
null: false,
description: 'ID (global ID) of the error.'
field :sentry_id, GraphQL::Types::String,
method: :id,
null: false,
description: 'ID (Sentry ID) of the error.'
field :first_seen, Types::TimeType,
null: false,
description: 'Timestamp when the error was first seen.'
field :last_seen, Types::TimeType,
null: false,
description: 'Timestamp when the error was last seen.'
field :title, GraphQL::Types::String,
null: false,
description: 'Title of the error.'
field :type, GraphQL::Types::String,
null: false,
description: 'Type of the error.'
field :user_count, GraphQL::Types::Int,
null: false,
description: 'Count of users affected by the error.'
field :count, GraphQL::Types::Int, field :count, GraphQL::Types::Int,
null: false, null: false,
description: 'Count of occurrences.' description: 'Count of occurrences.'
field :message, GraphQL::Types::String,
null: true,
description: 'Sentry metadata message of the error.'
field :culprit, GraphQL::Types::String, field :culprit, GraphQL::Types::String,
null: false, null: false,
description: 'Culprit of the error.' description: 'Culprit of the error.'
field :external_url, GraphQL::Types::String, field :external_url, GraphQL::Types::String,
null: false, null: false,
description: 'External URL of the error.' description: 'External URL of the error.'
field :short_id, GraphQL::Types::String, field :first_seen, Types::TimeType,
null: false,
description: 'Short ID (Sentry ID) of the error.'
field :status, Types::ErrorTracking::SentryErrorStatusEnum,
null: false, null: false,
description: 'Status of the error.' description: 'Timestamp when the error was first seen.'
field :frequency, [Types::ErrorTracking::SentryErrorFrequencyType], field :frequency, [Types::ErrorTracking::SentryErrorFrequencyType],
null: false, null: false,
description: 'Last 24hr stats of the error.' description: 'Last 24hr stats of the error.'
field :id, GraphQL::Types::ID,
null: false,
description: 'ID (global ID) of the error.'
field :last_seen, Types::TimeType,
null: false,
description: 'Timestamp when the error was last seen.'
field :message, GraphQL::Types::String,
null: true,
description: 'Sentry metadata message of the error.'
field :sentry_id, GraphQL::Types::String,
method: :id,
null: false,
description: 'ID (Sentry ID) of the error.'
field :sentry_project_id, GraphQL::Types::ID, field :sentry_project_id, GraphQL::Types::ID,
method: :project_id, method: :project_id,
null: false, null: false,
...@@ -64,6 +49,21 @@ module Types ...@@ -64,6 +49,21 @@ module Types
method: :project_slug, method: :project_slug,
null: false, null: false,
description: 'Slug of the project affected by the error.' description: 'Slug of the project affected by the error.'
field :short_id, GraphQL::Types::String,
null: false,
description: 'Short ID (Sentry ID) of the error.'
field :status, Types::ErrorTracking::SentryErrorStatusEnum,
null: false,
description: 'Status of the error.'
field :title, GraphQL::Types::String,
null: false,
description: 'Title of the error.'
field :type, GraphQL::Types::String,
null: false,
description: 'Type of the error.'
field :user_count, GraphQL::Types::Int,
null: false,
description: 'Count of users affected by the error.'
end end
# rubocop: enable Graphql/AuthorizeTypes # rubocop: enable Graphql/AuthorizeTypes
end end
......
...@@ -9,13 +9,13 @@ module Types ...@@ -9,13 +9,13 @@ module Types
present_using Releases::EvidencePresenter present_using Releases::EvidencePresenter
field :collected_at, Types::TimeType, null: true,
description: 'Timestamp when the evidence was collected.'
field :filepath, GraphQL::Types::String, null: true,
description: 'URL from where the evidence can be downloaded.'
field :id, GraphQL::Types::ID, null: false, field :id, GraphQL::Types::ID, null: false,
description: 'ID of the evidence.' description: 'ID of the evidence.'
field :sha, GraphQL::Types::String, null: true, field :sha, GraphQL::Types::String, null: true,
description: 'SHA1 ID of the evidence hash.' description: 'SHA1 ID of the evidence hash.'
field :filepath, GraphQL::Types::String, null: true,
description: 'URL from where the evidence can be downloaded.'
field :collected_at, Types::TimeType, null: true,
description: 'Timestamp when the evidence was collected.'
end end
end end
...@@ -6,14 +6,14 @@ module Types ...@@ -6,14 +6,14 @@ module Types
authorize :admin_operations authorize :admin_operations
field :id, GraphQL::Types::ID, null: false,
description: 'Internal ID of the Grafana integration.'
field :grafana_url, GraphQL::Types::String, null: false,
description: 'URL for the Grafana host for the Grafana integration.'
field :enabled, GraphQL::Types::Boolean, null: false,
description: 'Indicates whether Grafana integration is enabled.'
field :created_at, Types::TimeType, null: false, field :created_at, Types::TimeType, null: false,
description: 'Timestamp of the issue\'s creation.' description: 'Timestamp of the issue\'s creation.'
field :enabled, GraphQL::Types::Boolean, null: false,
description: 'Indicates whether Grafana integration is enabled.'
field :grafana_url, GraphQL::Types::String, null: false,
description: 'URL for the Grafana host for the Grafana integration.'
field :id, GraphQL::Types::ID, null: false,
description: 'Internal ID of the Grafana integration.'
field :updated_at, Types::TimeType, null: false, field :updated_at, Types::TimeType, null: false,
description: 'Timestamp of the issue\'s last activity.' description: 'Timestamp of the issue\'s last activity.'
end end
......
...@@ -15,16 +15,16 @@ module Types ...@@ -15,16 +15,16 @@ module Types
present_using IssuePresenter present_using IssuePresenter
field :description, GraphQL::Types::String, null: true,
description: 'Description of the issue.'
field :id, GraphQL::Types::ID, null: false, field :id, GraphQL::Types::ID, null: false,
description: "ID of the issue." description: "ID of the issue."
field :iid, GraphQL::Types::ID, null: false, field :iid, GraphQL::Types::ID, null: false,
description: "Internal ID of the issue." description: "Internal ID of the issue."
field :title, GraphQL::Types::String, null: false,
description: 'Title of the issue.'
field :description, GraphQL::Types::String, null: true,
description: 'Description of the issue.'
field :state, IssueStateEnum, null: false, field :state, IssueStateEnum, null: false,
description: 'State of the issue.' description: 'State of the issue.'
field :title, GraphQL::Types::String, null: false,
description: 'Title of the issue.'
field :reference, GraphQL::Types::String, null: false, field :reference, GraphQL::Types::String, 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.',
...@@ -47,52 +47,52 @@ module Types ...@@ -47,52 +47,52 @@ module Types
field :milestone, Types::MilestoneType, null: true, 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.'
field :confidential, GraphQL::Types::Boolean, null: false, field :confidential, GraphQL::Types::Boolean, null: false,
description: 'Indicates the issue is confidential.' description: 'Indicates the issue is confidential.'
field :discussion_locked, GraphQL::Types::Boolean, null: false,
description: 'Indicates discussion is locked on the issue.'
field :due_date, Types::TimeType, null: true,
description: 'Due date of the issue.'
field :hidden, GraphQL::Types::Boolean, null: true, resolver_method: :hidden?, field :hidden, GraphQL::Types::Boolean, null: true, resolver_method: :hidden?,
description: 'Indicates the issue is hidden because the author has been banned. ' \ description: 'Indicates the issue is hidden because the author has been banned. ' \
'Will always return `null` if `ban_user_feature_flag` feature flag is disabled.' 'Will always return `null` if `ban_user_feature_flag` feature flag is disabled.'
field :discussion_locked, GraphQL::Types::Boolean, null: false,
description: 'Indicates discussion is locked on the issue.'
field :upvotes, GraphQL::Types::Int, null: false,
description: 'Number of upvotes the issue has received.'
field :downvotes, GraphQL::Types::Int, null: false, field :downvotes, GraphQL::Types::Int, null: false,
description: 'Number of downvotes the issue has received.' description: 'Number of downvotes the issue has received.'
field :merge_requests_count, GraphQL::Types::Int, null: false, field :merge_requests_count, GraphQL::Types::Int, null: false,
description: 'Number of merge requests that close the issue on merge.', description: 'Number of merge requests that close the issue on merge.',
resolver: Resolvers::MergeRequestsCountResolver resolver: Resolvers::MergeRequestsCountResolver
field :user_notes_count, GraphQL::Types::Int, null: false, field :relative_position, GraphQL::Types::Int, null: true,
description: 'Number of user notes of the issue.', description: 'Relative position of the issue (used for positioning in epic tree and issue boards).'
resolver: Resolvers::UserNotesCountResolver field :upvotes, GraphQL::Types::Int, null: false,
description: 'Number of upvotes the issue has received.'
field :user_discussions_count, GraphQL::Types::Int, null: false, field :user_discussions_count, GraphQL::Types::Int, null: false,
description: 'Number of user discussions in the issue.', description: 'Number of user discussions in the issue.',
resolver: Resolvers::UserDiscussionsCountResolver resolver: Resolvers::UserDiscussionsCountResolver
field :user_notes_count, GraphQL::Types::Int, null: false,
description: 'Number of user notes of the issue.',
resolver: Resolvers::UserNotesCountResolver
field :web_path, GraphQL::Types::String, null: false, method: :issue_path, field :web_path, GraphQL::Types::String, null: false, method: :issue_path,
description: 'Web path of the issue.' description: 'Web path of the issue.'
field :web_url, GraphQL::Types::String, null: false, field :web_url, GraphQL::Types::String, null: false,
description: 'Web URL of the issue.' description: 'Web URL of the issue.'
field :relative_position, GraphQL::Types::Int, null: true,
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.',
resolver: Resolvers::Users::ParticipantsResolver
field :emails_disabled, GraphQL::Types::Boolean, null: false, field :emails_disabled, GraphQL::Types::Boolean, null: false,
method: :project_emails_disabled?, 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 :human_time_estimate, GraphQL::Types::String, null: true,
description: 'Human-readable time estimate of the issue.'
field :human_total_time_spent, GraphQL::Types::String, null: true,
description: 'Human-readable total time reported as spent on the issue.'
field :participants, Types::UserType.connection_type, null: true, complexity: 5,
description: 'List of participants in the issue.',
resolver: Resolvers::Users::ParticipantsResolver
field :subscribed, GraphQL::Types::Boolean, method: :subscribed?, null: false, complexity: 5, field :subscribed, GraphQL::Types::Boolean, 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::Types::Int, null: false, field :time_estimate, GraphQL::Types::Int, null: false,
description: 'Time estimate of the issue.' description: 'Time estimate of the issue.'
field :total_time_spent, GraphQL::Types::Int, null: false, field :total_time_spent, GraphQL::Types::Int, 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::Types::String, null: true,
description: 'Human-readable time estimate of the issue.'
field :human_total_time_spent, GraphQL::Types::String, null: true,
description: 'Human-readable total time reported as spent on the issue.'
field :closed_at, Types::TimeType, null: true, field :closed_at, Types::TimeType, null: true,
description: 'Timestamp of when the issue was closed.' description: 'Timestamp of when the issue was closed.'
......
...@@ -8,16 +8,16 @@ module Types ...@@ -8,16 +8,16 @@ module Types
field :created_at, Types::TimeType, null: true, 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 :failed_to_import_count, GraphQL::Types::Int, null: false,
description: 'Count of issues that failed to import.'
field :imported_issues_count, GraphQL::Types::Int, null: false,
description: 'Count of issues that were successfully imported.'
field :jira_project_key, GraphQL::Types::String, null: false,
description: 'Project key for the imported Jira project.'
field :scheduled_at, Types::TimeType, null: true, 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, 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::Types::String, null: false,
description: 'Project key for the imported Jira project.'
field :imported_issues_count, GraphQL::Types::Int, null: false,
description: 'Count of issues that were successfully imported.'
field :failed_to_import_count, GraphQL::Types::Int, null: false,
description: 'Count of issues that failed to import.'
field :total_issue_count, GraphQL::Types::Int, null: false, field :total_issue_count, GraphQL::Types::Int, null: false,
description: 'Total count of issues that were attempted to import.' description: 'Total count of issues that were attempted to import.'
end end
......
...@@ -6,18 +6,18 @@ module Types ...@@ -6,18 +6,18 @@ module Types
class JiraUserType < BaseObject class JiraUserType < BaseObject
graphql_name 'JiraUser' graphql_name 'JiraUser'
field :gitlab_id, GraphQL::Types::Int, null: true,
description: 'ID of the matched GitLab user.'
field :gitlab_name, GraphQL::Types::String, null: true,
description: 'Name of the matched GitLab user.'
field :gitlab_username, GraphQL::Types::String, null: true,
description: 'Username of the matched GitLab user.'
field :jira_account_id, GraphQL::Types::String, null: false, field :jira_account_id, GraphQL::Types::String, null: false,
description: 'Account ID of the Jira user.' description: 'Account ID of the Jira user.'
field :jira_display_name, GraphQL::Types::String, null: false, field :jira_display_name, GraphQL::Types::String, null: false,
description: 'Display name of the Jira user.' description: 'Display name of the Jira user.'
field :jira_email, GraphQL::Types::String, null: true, field :jira_email, GraphQL::Types::String, 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::Types::Int, null: true,
description: 'ID of the matched GitLab user.'
field :gitlab_username, GraphQL::Types::String, null: true,
description: 'Username of the matched GitLab user.'
field :gitlab_name, GraphQL::Types::String, null: true,
description: 'Name of the matched GitLab user.'
end end
# rubocop: enable Graphql/AuthorizeTypes # rubocop: enable Graphql/AuthorizeTypes
end end
...@@ -8,18 +8,18 @@ module Types ...@@ -8,18 +8,18 @@ module Types
authorize :read_label authorize :read_label
field :id, GraphQL::Types::ID, null: false,
description: 'Label ID.'
field :description, GraphQL::Types::String, null: true,
description: 'Description of the label (Markdown rendered as HTML for caching).'
field :title, GraphQL::Types::String, null: false,
description: 'Content of the label.'
field :color, GraphQL::Types::String, null: false, field :color, GraphQL::Types::String, null: false,
description: 'Background color of the label.' description: 'Background color of the label.'
field :text_color, GraphQL::Types::String, null: false,
description: 'Text color of the label.'
field :created_at, Types::TimeType, null: false, field :created_at, Types::TimeType, null: false,
description: 'When this label was created.' description: 'When this label was created.'
field :description, GraphQL::Types::String, null: true,
description: 'Description of the label (Markdown rendered as HTML for caching).'
field :id, GraphQL::Types::ID, null: false,
description: 'Label ID.'
field :text_color, GraphQL::Types::String, null: false,
description: 'Text color of the label.'
field :title, GraphQL::Types::String, null: false,
description: 'Content of the label.'
field :updated_at, Types::TimeType, null: false, field :updated_at, Types::TimeType, null: false,
description: 'When this label was last updated.' description: 'When this label was last updated.'
......
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