Commit a4dce597 authored by Alex Kalderimis's avatar Alex Kalderimis

Fix rubocop errors by adding type annotations

This types user merge request resolvers as returning Merge Request
connections.

Additionally, the base class is renamed so it is not mistaken for an
actual resolver.
parent 5b591e25
...@@ -47,8 +47,6 @@ Graphql/IDType: ...@@ -47,8 +47,6 @@ Graphql/IDType:
Graphql/ResolverType: Graphql/ResolverType:
Exclude: Exclude:
- 'app/graphql/resolvers/assigned_merge_requests_resolver.rb'
- 'app/graphql/resolvers/authored_merge_requests_resolver.rb'
- 'app/graphql/resolvers/base_resolver.rb' - 'app/graphql/resolvers/base_resolver.rb'
- 'app/graphql/resolvers/ci/pipeline_stages_resolver.rb' - 'app/graphql/resolvers/ci/pipeline_stages_resolver.rb'
- 'app/graphql/resolvers/commit_pipelines_resolver.rb' - 'app/graphql/resolvers/commit_pipelines_resolver.rb'
...@@ -65,7 +63,6 @@ Graphql/ResolverType: ...@@ -65,7 +63,6 @@ Graphql/ResolverType:
- 'app/graphql/resolvers/project_pipelines_resolver.rb' - 'app/graphql/resolvers/project_pipelines_resolver.rb'
- 'app/graphql/resolvers/projects/snippets_resolver.rb' - 'app/graphql/resolvers/projects/snippets_resolver.rb'
- 'app/graphql/resolvers/snippets_resolver.rb' - 'app/graphql/resolvers/snippets_resolver.rb'
- 'app/graphql/resolvers/user_merge_requests_resolver.rb'
- 'app/graphql/resolvers/users/group_count_resolver.rb' - 'app/graphql/resolvers/users/group_count_resolver.rb'
- 'app/graphql/resolvers/users/snippets_resolver.rb' - 'app/graphql/resolvers/users/snippets_resolver.rb'
- 'ee/app/graphql/resolvers/ci/jobs_resolver.rb' - 'ee/app/graphql/resolvers/ci/jobs_resolver.rb'
......
# frozen_string_literal: true # frozen_string_literal: true
module Resolvers module Resolvers
class AssignedMergeRequestsResolver < UserMergeRequestsResolver class AssignedMergeRequestsResolver < UserMergeRequestsResolverBase
type ::Types::MergeRequestType.connection_type, null: true
accept_author accept_author
def user_role def user_role
......
# frozen_string_literal: true # frozen_string_literal: true
module Resolvers module Resolvers
class AuthoredMergeRequestsResolver < UserMergeRequestsResolver class AuthoredMergeRequestsResolver < UserMergeRequestsResolverBase
type ::Types::MergeRequestType.connection_type, null: true
accept_assignee accept_assignee
def user_role def user_role
......
# frozen_string_literal: true # frozen_string_literal: true
module Resolvers module Resolvers
class UserMergeRequestsResolver < MergeRequestsResolver class UserMergeRequestsResolverBase < MergeRequestsResolver
include ResolvesProject include ResolvesProject
argument :project_path, GraphQL::STRING_TYPE, argument :project_path, GraphQL::STRING_TYPE,
......
...@@ -46,10 +46,10 @@ module Types ...@@ -46,10 +46,10 @@ module Types
resolver: Resolvers::UserStarredProjectsResolver resolver: Resolvers::UserStarredProjectsResolver
# Merge request field: MRs can be either authored or assigned: # Merge request field: MRs can be either authored or assigned:
field :authored_merge_requests, Types::MergeRequestType.connection_type, null: true, field :authored_merge_requests,
resolver: Resolvers::AuthoredMergeRequestsResolver, resolver: Resolvers::AuthoredMergeRequestsResolver,
description: 'Merge Requests authored by the user' description: 'Merge Requests authored by the user'
field :assigned_merge_requests, Types::MergeRequestType.connection_type, null: true, field :assigned_merge_requests,
resolver: Resolvers::AssignedMergeRequestsResolver, resolver: Resolvers::AssignedMergeRequestsResolver,
description: 'Merge Requests assigned to the user' description: 'Merge Requests assigned to the user'
......
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