Commit 81227826 authored by Imre Farkas's avatar Imre Farkas

Merge branch 'ph/typeAnnotations' into 'master'

Added type annotations to some GraphQL resolvers

See merge request gitlab-org/gitlab!47634
parents 5dfa5a52 8bbd7d2e
......@@ -43,11 +43,8 @@ Graphql/ResolverType:
Exclude:
- 'app/graphql/resolvers/base_resolver.rb'
- 'app/graphql/resolvers/ci/pipeline_stages_resolver.rb'
- 'app/graphql/resolvers/commit_pipelines_resolver.rb'
- 'app/graphql/resolvers/error_tracking/sentry_error_stack_trace_resolver.rb'
- 'app/graphql/resolvers/merge_request_pipelines_resolver.rb'
- 'app/graphql/resolvers/merge_requests_resolver.rb'
- 'app/graphql/resolvers/project_pipelines_resolver.rb'
- 'app/graphql/resolvers/users/group_count_resolver.rb'
- 'ee/app/graphql/resolvers/ci/jobs_resolver.rb'
- 'ee/app/graphql/resolvers/geo/merge_request_diff_registries_resolver.rb'
......
# frozen_string_literal: true
# rubocop: disable Graphql/ResolverType
module Resolvers
class CommitPipelinesResolver < BaseResolver
# The GraphQL type here gets defined in this include
include ::ResolvesPipelines
alias_method :commit, :object
......@@ -11,3 +13,4 @@ module Resolvers
end
end
end
# rubocop: enable Graphql/ResolverType
......@@ -4,7 +4,7 @@ module ResolvesPipelines
extend ActiveSupport::Concern
included do
type [Types::Ci::PipelineType], null: false
type Types::Ci::PipelineType.connection_type, null: false
argument :status,
Types::Ci::PipelineStatusEnum,
required: false,
......
# frozen_string_literal: true
# rubocop: disable Graphql/ResolverType
module Resolvers
class MergeRequestPipelinesResolver < BaseResolver
# The GraphQL type here gets defined in this include
include ::ResolvesPipelines
alias_method :merge_request, :object
......@@ -18,3 +20,4 @@ module Resolvers
end
end
end
# rubocop: enable Graphql/ResolverType
# frozen_string_literal: true
# The GraphQL type here gets defined in
# https://gitlab.com/gitlab-org/gitlab/blob/master/app/graphql/resolvers/concerns/resolves_pipelines.rb#L7
# rubocop: disable Graphql/ResolverType
module Resolvers
class ProjectPipelinesResolver < BaseResolver
......@@ -22,3 +25,4 @@ module Resolvers
end
end
end
# rubocop: enable Graphql/ResolverType
......@@ -40,7 +40,7 @@ module Types
field :author, type: Types::UserType, null: true,
description: 'Author of the commit'
field :pipelines, Types::Ci::PipelineType.connection_type,
field :pipelines,
null: true,
description: 'Pipelines of the commit ordered latest first',
resolver: Resolvers::CommitPipelinesResolver
......
......@@ -114,7 +114,7 @@ module Types
field :head_pipeline, Types::Ci::PipelineType, null: true, method: :actual_head_pipeline,
description: 'The pipeline running on the branch HEAD of the merge request'
field :pipelines, Types::Ci::PipelineType.connection_type,
field :pipelines,
null: true,
description: 'Pipelines for the merge request',
resolver: Resolvers::MergeRequestPipelinesResolver
......
......@@ -187,7 +187,6 @@ module Types
resolver: Resolvers::PackagesResolver
field :pipelines,
Types::Ci::PipelineType.connection_type,
null: true,
description: 'Build pipelines of the project',
extras: [:lookahead],
......
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