Class: Gitlab::Graphql::Project::DastProfileConnectionExtension
- Inherits:
-
GraphQL::Schema::FieldExtension
- Object
- GraphQL::Schema::FieldExtension
- Gitlab::Graphql::Project::DastProfileConnectionExtension
- Defined in:
- lib/gitlab/graphql/project/dast_profile_connection_extension.rb
Instance Method Summary collapse
- #after_resolve(value:, object:, context:, **rest) ⇒ Object
- #preload_authorizations(dast_profiles) ⇒ Object
Instance Method Details
#after_resolve(value:, object:, context:, **rest) ⇒ Object
6 7 8 9 10 |
# File 'lib/gitlab/graphql/project/dast_profile_connection_extension.rb', line 6 def after_resolve(value:, object:, context:, **rest) (context[:project_dast_profiles]) context[:project_dast_profiles] = nil value end |
#preload_authorizations(dast_profiles) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/gitlab/graphql/project/dast_profile_connection_extension.rb', line 12 def (dast_profiles) return unless dast_profiles project_users = dast_profiles.group_by(&:project).transform_values do |project_profiles| project_profiles .filter_map { |profile| profile.dast_profile_schedule&.owner } .uniq end Preloaders::UsersMaxAccessLevelByProjectPreloader.new(project_users: project_users).execute end |