Commit a374ce23 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch 'ajk-281697-resolver-types' into 'master'

Add type annotations to graphql resolvers

See merge request gitlab-org/gitlab!47647
parents 54735029 68a49c5e
...@@ -45,13 +45,8 @@ Graphql/ResolverType: ...@@ -45,13 +45,8 @@ Graphql/ResolverType:
- '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'
- 'app/graphql/resolvers/error_tracking/sentry_error_stack_trace_resolver.rb' - 'app/graphql/resolvers/error_tracking/sentry_error_stack_trace_resolver.rb'
- 'app/graphql/resolvers/group_issues_resolver.rb'
- 'app/graphql/resolvers/group_merge_requests_resolver.rb'
- 'app/graphql/resolvers/members_resolver.rb'
- 'app/graphql/resolvers/merge_request_pipelines_resolver.rb' - 'app/graphql/resolvers/merge_request_pipelines_resolver.rb'
- 'app/graphql/resolvers/merge_request_resolver.rb'
- 'app/graphql/resolvers/merge_requests_resolver.rb' - 'app/graphql/resolvers/merge_requests_resolver.rb'
- 'app/graphql/resolvers/project_merge_requests_resolver.rb'
- 'app/graphql/resolvers/project_pipelines_resolver.rb' - 'app/graphql/resolvers/project_pipelines_resolver.rb'
- 'app/graphql/resolvers/users/group_count_resolver.rb' - 'app/graphql/resolvers/users/group_count_resolver.rb'
- 'ee/app/graphql/resolvers/ci/jobs_resolver.rb' - 'ee/app/graphql/resolvers/ci/jobs_resolver.rb'
......
...@@ -4,6 +4,7 @@ module LooksAhead ...@@ -4,6 +4,7 @@ module LooksAhead
extend ActiveSupport::Concern extend ActiveSupport::Concern
included do included do
extras [:lookahead]
attr_accessor :lookahead attr_accessor :lookahead
end end
......
# frozen_string_literal: true # frozen_string_literal: true
# rubocop:disable Graphql/ResolverType (inherited from IssuesResolver)
module Resolvers module Resolvers
class GroupIssuesResolver < IssuesResolver class GroupIssuesResolver < IssuesResolver
......
...@@ -6,6 +6,8 @@ module Resolvers ...@@ -6,6 +6,8 @@ module Resolvers
alias_method :group, :synchronized_object alias_method :group, :synchronized_object
type Types::MergeRequestType.connection_type, null: true
include_subgroups 'merge requests' include_subgroups 'merge requests'
accept_assignee accept_assignee
accept_author accept_author
......
# frozen_string_literal: true # frozen_string_literal: true
# rubocop:disable Graphql/ResolverType (inherited from MilestonesResolver)
module Resolvers module Resolvers
class GroupMilestonesResolver < MilestonesResolver class GroupMilestonesResolver < MilestonesResolver
......
...@@ -5,6 +5,8 @@ module Resolvers ...@@ -5,6 +5,8 @@ module Resolvers
include Gitlab::Graphql::Authorize::AuthorizeResource include Gitlab::Graphql::Authorize::AuthorizeResource
include LooksAhead include LooksAhead
type Types::MemberInterface.connection_type, null: true
argument :search, GraphQL::STRING_TYPE, argument :search, GraphQL::STRING_TYPE,
required: false, required: false,
description: 'Search query' description: 'Search query'
......
...@@ -6,6 +6,8 @@ module Resolvers ...@@ -6,6 +6,8 @@ module Resolvers
alias_method :project, :synchronized_object alias_method :project, :synchronized_object
type ::Types::MergeRequestType, null: true
argument :iid, GraphQL::STRING_TYPE, argument :iid, GraphQL::STRING_TYPE,
required: true, required: true,
as: :iids, as: :iids,
......
# frozen_string_literal: true # frozen_string_literal: true
# rubocop:disable Graphql/ResolverType (inherited from MembersResolver)
module Resolvers module Resolvers
class ProjectMembersResolver < MembersResolver class ProjectMembersResolver < MembersResolver
type Types::MemberInterface, null: true
authorize :read_project_member authorize :read_project_member
private private
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
module Resolvers module Resolvers
class ProjectMergeRequestsResolver < MergeRequestsResolver class ProjectMergeRequestsResolver < MergeRequestsResolver
type ::Types::MergeRequestType.connection_type, null: true
accept_assignee accept_assignee
accept_author accept_author
end end
......
# frozen_string_literal: true # frozen_string_literal: true
# rubocop:disable Graphql/ResolverType (inherited from MilestonesResolver)
module Resolvers module Resolvers
class ProjectMilestonesResolver < MilestonesResolver class ProjectMilestonesResolver < MilestonesResolver
......
# frozen_string_literal: true # frozen_string_literal: true
# rubocop:disable Graphql/ResolverType # rubocop:disable Graphql/ResolverType (inherited from ResolvesSnippets)
module Resolvers module Resolvers
module Projects module Projects
......
# frozen_string_literal: true # frozen_string_literal: true
# rubocop:disable Graphql/ResolverType # rubocop:disable Graphql/ResolverType (inherited from ResolvesSnippets)
module Resolvers module Resolvers
class SnippetsResolver < BaseResolver class SnippetsResolver < BaseResolver
......
# frozen_string_literal: true # frozen_string_literal: true
# rubocop:disable Graphql/ResolverType # rubocop:disable Graphql/ResolverType (inherited from ResolvesSnippets)
module Resolvers module Resolvers
module Users module Users
......
...@@ -86,9 +86,7 @@ module Types ...@@ -86,9 +86,7 @@ module Types
end end
field :group_members, field :group_members,
Types::GroupMemberType.connection_type,
description: 'A membership of a user within this group', description: 'A membership of a user within this group',
extras: [:lookahead],
resolver: Resolvers::GroupMembersResolver resolver: Resolvers::GroupMembersResolver
field :container_repositories, field :container_repositories,
......
...@@ -161,7 +161,6 @@ module Types ...@@ -161,7 +161,6 @@ module Types
resolver: Resolvers::ProjectMilestonesResolver resolver: Resolvers::ProjectMilestonesResolver
field :project_members, field :project_members,
Types::MemberInterface.connection_type,
description: 'Members of the project', description: 'Members of the project',
resolver: Resolvers::ProjectMembersResolver resolver: Resolvers::ProjectMembersResolver
......
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