Skip to content

Expose active parameter to the Projects GQL API

Expose the active parameter added in #525631 (closed) to the Projects GQL API

Implementation Guide

After #525631 (closed) has been completed.

  1. In app/graphql/resolvers/projects_resolver.rb, add active as a new supported boolean argument.
    argument :active, GraphQL::Types::Boolean,
      required: false,
      description: "Filters by projects that are not archived. For Premium or Ultimate, projects that are marked for deletion are also filtered."
  1. Ensure that the active argument gets passed to the ProjectFinder in updating finder_params
    def finder_params(args)
      {
        **project_finder_params(args),
        with_issues_enabled: args[:with_issues_enabled],
        with_merge_requests_enabled: args[:with_merge_requests_enabled],
        full_paths: args[:full_paths],
        archived: args[:archived],
        min_access_level: args[:min_access_level],
        language_name: args[:programming_language_name],
        trending: args[:trending],
        not_aimed_for_deletion: args[:not_aimed_for_deletion],
+       active: args[:active],
        current_organization: ::Current.organization
      }
    end
  1. Run bundle exec rake gitlab:graphql:compile_docs to update the documentation.
  2. Add the appropriate specs.
Edited by Shane Maglangit