diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 15:44:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 15:44:42 +0000 |
commit | 4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch) | |
tree | 5423a1c7516cffe36384133ade12572cf709398d /app/graphql/types/query_type.rb | |
parent | e570267f2f6b326480d284e0164a6464ba4081bc (diff) | |
download | gitlab-ce-4555e1b21c365ed8303ffb7a3325d773c9b8bf31.tar.gz |
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to 'app/graphql/types/query_type.rb')
-rw-r--r-- | app/graphql/types/query_type.rb | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/app/graphql/types/query_type.rb b/app/graphql/types/query_type.rb index 8af0db644dd..8b7b9f0107b 100644 --- a/app/graphql/types/query_type.rb +++ b/app/graphql/types/query_type.rb @@ -79,8 +79,14 @@ module Types 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 :merge_request, Types::MergeRequestType, + null: true, + description: 'Find a merge request.' do + argument :id, ::Types::GlobalIDType[::MergeRequest], required: true, description: 'The global ID of the merge request.' end field :instance_statistics_measurements, @@ -106,6 +112,19 @@ module Types field :runner_platforms, resolver: Resolvers::Ci::RunnerPlatformsResolver field :runner_setup, resolver: Resolvers::Ci::RunnerSetupResolver + field :runner, Types::Ci::RunnerType, + null: true, + resolver: Resolvers::Ci::RunnerResolver, + extras: [:lookahead], + description: "Find a runner.", + feature_flag: :runner_graphql_query + + field :runners, Types::Ci::RunnerType.connection_type, + null: true, + resolver: Resolvers::Ci::RunnersResolver, + description: "Find runners visible to the current user.", + feature_flag: :runner_graphql_query + field :ci_config, resolver: Resolvers::Ci::ConfigResolver, complexity: 126 # AUTHENTICATED_COMPLEXITY / 2 + 1 def design_management @@ -119,6 +138,13 @@ module Types GitlabSchema.find_by_gid(id) end + def merge_request(id:) + # TODO: remove this line when the compatibility layer is removed + # See: https://gitlab.com/gitlab-org/gitlab/-/issues/257883 + id = ::Types::GlobalIDType[::MergeRequest].coerce_isolated_input(id) + GitlabSchema.find_by_gid(id) + end + def milestone(id:) # TODO: remove this line when the compatibility layer is removed # See: https://gitlab.com/gitlab-org/gitlab/-/issues/257883 @@ -147,4 +173,4 @@ module Types end end -Types::QueryType.prepend_if_ee('EE::Types::QueryType') +Types::QueryType.prepend_mod_with('Types::QueryType') |