Class: Types::QueryType
- Inherits:
-
BaseObject
- Object
- GraphQL::Schema::Object
- BaseObject
- Types::QueryType
- Defined in:
- app/graphql/types/query_type.rb
Defined Under Namespace
Classes: DesignManagementObject
Instance Method Summary collapse
- #application_settings ⇒ Object
- #ci_application_settings ⇒ Object
- #ci_pipeline_stage(id:) ⇒ Object
- #container_repository(id:) ⇒ Object
- #current_user ⇒ Object
- #design_management ⇒ Object
- #gitpod_enabled ⇒ Object
- #issue(id:) ⇒ Object
- #job_token_policies_by_category ⇒ Object
- #merge_request(id:) ⇒ Object
- #milestone(id:, lookahead:) ⇒ Object
- #note(id:) ⇒ Object
- #query_complexity ⇒ Object
Methods inherited from BaseObject
accepts, assignable?, authorization, authorization_scopes, authorize, authorized?, #id
Methods included from Gitlab::Graphql::Present
Instance Method Details
#application_settings ⇒ Object
285 286 287 |
# File 'app/graphql/types/query_type.rb', line 285 def application_settings Gitlab::CurrentSettings.current_application_settings end |
#ci_application_settings ⇒ Object
281 282 283 |
# File 'app/graphql/types/query_type.rb', line 281 def ci_application_settings application_settings end |
#ci_pipeline_stage(id:) ⇒ Object
297 298 299 300 301 302 303 304 |
# File 'app/graphql/types/query_type.rb', line 297 def ci_pipeline_stage(id:) stage = ::Gitlab::Graphql::Lazy.force(GitlabSchema.find_by_gid(id)) = Ability.allowed?(current_user, :read_build, stage.project) return unless stage end |
#container_repository(id:) ⇒ Object
273 274 275 |
# File 'app/graphql/types/query_type.rb', line 273 def container_repository(id:) GitlabSchema.find_by_gid(id) end |
#current_user ⇒ Object
277 278 279 |
# File 'app/graphql/types/query_type.rb', line 277 def current_user context[:current_user] end |
#design_management ⇒ Object
252 253 254 |
# File 'app/graphql/types/query_type.rb', line 252 def design_management DesignManagementObject.new(nil) end |
#gitpod_enabled ⇒ Object
289 290 291 |
# File 'app/graphql/types/query_type.rb', line 289 def gitpod_enabled application_settings.gitpod_enabled end |
#issue(id:) ⇒ Object
256 257 258 |
# File 'app/graphql/types/query_type.rb', line 256 def issue(id:) GitlabSchema.find_by_gid(id) end |
#job_token_policies_by_category ⇒ Object
306 307 308 |
# File 'app/graphql/types/query_type.rb', line 306 def job_token_policies_by_category ::Ci::JobToken::Policies::POLICIES_BY_CATEGORY end |
#merge_request(id:) ⇒ Object
264 265 266 |
# File 'app/graphql/types/query_type.rb', line 264 def merge_request(id:) GitlabSchema.find_by_gid(id) end |
#milestone(id:, lookahead:) ⇒ Object
268 269 270 271 |
# File 'app/graphql/types/query_type.rb', line 268 def milestone(id:, lookahead:) preloads = [:releases] if lookahead.selects?(:releases) Gitlab::Graphql::Loaders::BatchModelLoader.new(id.model_class, id.model_id, preloads).find end |
#note(id:) ⇒ Object
260 261 262 |
# File 'app/graphql/types/query_type.rb', line 260 def note(id:) GitlabSchema.find_by_gid(id) end |
#query_complexity ⇒ Object
293 294 295 |
# File 'app/graphql/types/query_type.rb', line 293 def query_complexity context.query end |