Class: Types::QueryType
Defined Under Namespace
Classes: DesignManagementObject
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from BaseObject
accepts, assignable?, authorization, authorize, authorized?, #id
#present, #unpresented
Class Method Details
.authorization_scopes ⇒ Object
10
11
12
|
# File 'app/graphql/types/query_type.rb', line 10
def self.authorization_scopes
super + [:ai_workflows]
end
|
Instance Method Details
#application_settings ⇒ Object
#ci_application_settings ⇒ Object
319
320
321
|
# File 'app/graphql/types/query_type.rb', line 319
def ci_application_settings
application_settings
end
|
#ci_pipeline_stage(id:) ⇒ Object
335
336
337
338
339
340
341
342
343
344
|
# File 'app/graphql/types/query_type.rb', line 335
def ci_pipeline_stage(id:)
stage = ::Gitlab::Graphql::Lazy.force(GitlabSchema.find_by_gid(id))
return unless stage
authorized = Ability.allowed?(current_user, :read_build, stage.project)
return unless authorized
stage
end
|
#container_repository(id:) ⇒ Object
311
312
313
|
# File 'app/graphql/types/query_type.rb', line 311
def container_repository(id:)
GitlabSchema.find_by_gid(id)
end
|
#current_user ⇒ Object
315
316
317
|
# File 'app/graphql/types/query_type.rb', line 315
def current_user
context[:current_user]
end
|
#design_management ⇒ Object
290
291
292
|
# File 'app/graphql/types/query_type.rb', line 290
def design_management
DesignManagementObject.new(nil)
end
|
#gitpod_enabled ⇒ Object
327
328
329
|
# File 'app/graphql/types/query_type.rb', line 327
def gitpod_enabled
application_settings.gitpod_enabled
end
|
#merge_request(id:) ⇒ Object
302
303
304
|
# File 'app/graphql/types/query_type.rb', line 302
def merge_request(id:)
GitlabSchema.find_by_gid(id)
end
|
#milestone(id:, lookahead:) ⇒ Object
306
307
308
309
|
# File 'app/graphql/types/query_type.rb', line 306
def milestone(id:, lookahead:)
preloads = [:releases] if lookahead.selects?(:releases)
Gitlab::Graphql::Loaders::BatchModelLoader.new(id.model_class, id.model_id, preloads).find
end
|
#query_complexity ⇒ Object
331
332
333
|
# File 'app/graphql/types/query_type.rb', line 331
def query_complexity
context.query
end
|